mirror of
https://github.com/saymrwulf/transformers.git
synced 2026-05-15 21:01:19 +00:00
[hubconf] Modify pythonpath to get canonical imports to work
See https://github.com/huggingface/transformers/pull/3881/files#r412292660 Should we remove SRC_DIR from sys.path right after the imports, @aaugustin?
This commit is contained in:
parent
77b75d2c78
commit
cbbb3c43c5
1 changed files with 9 additions and 2 deletions
11
hubconf.py
11
hubconf.py
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue