Skip to content

Commit

Permalink
[hubconf] Modify pythonpath to get canonical imports to work
Browse files Browse the repository at this point in the history
See https://github.com/huggingface/transformers/pull/3881/files#r412292660

Should we remove SRC_DIR from sys.path right after the imports, @aaugustin?
  • Loading branch information
julien-c committed Apr 23, 2020
1 parent 77b75d2 commit cbbb3c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hubconf.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from src.transformers import (
import os
import sys

SRC_DIR = os.path.join(os.path.dirname(__file__), "src")
sys.path.append(SRC_DIR)


from transformers import (
AutoConfig,
AutoModel,
AutoModelForQuestionAnswering,
AutoModelForSequenceClassification,
AutoModelWithLMHead,
AutoTokenizer,
add_start_docstrings,
)
from src.transformers.file_utils import add_start_docstrings


dependencies = ["torch", "numpy", "tokenizers", "boto3", "filelock", "requests", "tqdm", "regex", "sentencepiece", "sacremoses"]
Expand Down

0 comments on commit cbbb3c4

Please sign in to comment.