Spaces:
Running
Running
Update apis/chat_api.py
Browse files- apis/chat_api.py +2 -1
apis/chat_api.py
CHANGED
@@ -177,7 +177,8 @@ class ChatAPIApp:
|
|
177 |
real_name = MODEL_MAP[target_model]
|
178 |
read_model = AutoModelForSeq2SeqLM.from_pretrained(real_name)
|
179 |
tokenizer = AutoTokenizer.from_pretrained(real_name)
|
180 |
-
translator = pipeline("translation", model=read_model, tokenizer=tokenizer, src_lang=item.from_language, tgt_lang=item.to_language)
|
|
|
181 |
result = translator(item.input_text)
|
182 |
|
183 |
item_response = {
|
|
|
177 |
real_name = MODEL_MAP[target_model]
|
178 |
read_model = AutoModelForSeq2SeqLM.from_pretrained(real_name)
|
179 |
tokenizer = AutoTokenizer.from_pretrained(real_name)
|
180 |
+
#translator = pipeline("translation", model=read_model, tokenizer=tokenizer, src_lang=item.from_language, tgt_lang=item.to_language)
|
181 |
+
translator = pipeline("translation", model=real_name, src_lang=item.from_language, tgt_lang=item.to_language)
|
182 |
result = translator(item.input_text)
|
183 |
|
184 |
item_response = {
|