Spaces:
Sleeping
Sleeping
seyoungsong
commited on
Commit
•
e723e47
1
Parent(s):
68fdd8d
app.py
CHANGED
@@ -137,14 +137,15 @@ lang_to_code = {
|
|
137 |
lang_names = list(lang_to_code.keys())
|
138 |
|
139 |
# load model
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
task="translation", model="seyoungsong/flores101_mm100_175M"
|
145 |
)
|
146 |
-
|
147 |
-
|
|
|
|
|
148 |
|
149 |
# fix tokenizer
|
150 |
tokenizer.lang_token_to_id = {
|
|
|
137 |
lang_names = list(lang_to_code.keys())
|
138 |
|
139 |
# load model
|
140 |
+
model_path = Path("./model_files").resolve()
|
141 |
+
print(f"model_path: {model_path}")
|
142 |
+
tokenizer: M2M100Tokenizer = M2M100Tokenizer.from_pretrained(
|
143 |
+
pretrained_model_name_or_path=str(model_path), local_files_only=True
|
|
|
144 |
)
|
145 |
+
model = M2M100ForConditionalGeneration.from_pretrained(
|
146 |
+
pretrained_model_name_or_path=str(model_path), local_files_only=True
|
147 |
+
)
|
148 |
+
|
149 |
|
150 |
# fix tokenizer
|
151 |
tokenizer.lang_token_to_id = {
|