Commit
·
59752f1
1
Parent(s):
165028c
utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from transformers import AutoTokenizer
|
2 |
import logging
|
3 |
-
|
4 |
|
5 |
# Configure logging
|
6 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
@@ -8,10 +8,7 @@ logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %
|
|
8 |
def get_tokenizer(id):
|
9 |
logging.debug(f"Loading tokenizer: {id}")
|
10 |
try:
|
11 |
-
|
12 |
-
tokenizer = GemmaTokenizer.from_pretrained(id)
|
13 |
-
else:
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained(id, trust_remote_code=True)
|
15 |
logging.debug(f"Tokenizer loaded: {tokenizer}")
|
16 |
return tokenizer
|
17 |
except Exception as e:
|
|
|
1 |
from transformers import AutoTokenizer
|
2 |
import logging
|
3 |
+
import os
|
4 |
|
5 |
# Configure logging
|
6 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
8 |
def get_tokenizer(id):
|
9 |
logging.debug(f"Loading tokenizer: {id}")
|
10 |
try:
|
11 |
+
tokenizer = AutoTokenizer.from_pretrained(id, trust_remote_code=True, token=os.getenv("HF_TOKEN"))
|
|
|
|
|
|
|
12 |
logging.debug(f"Tokenizer loaded: {tokenizer}")
|
13 |
return tokenizer
|
14 |
except Exception as e:
|