Spaces:
Running
Running
Commit
·
afce631
1
Parent(s):
2228db6
changes
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import InferenceClient
|
|
5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
"""
|
7 |
englishToFinnishClient = InferenceClient("Helsinki-NLP/opus-mt-en-fi")
|
8 |
-
englishToSwedishClient = InferenceClient("facebook/
|
9 |
|
10 |
|
11 |
def respond(
|
@@ -24,12 +24,12 @@ def respond(
|
|
24 |
|
25 |
print("the text",message, 'the source',sourceLanguage,"the target",targetLanguage)
|
26 |
|
27 |
-
text=f">>{targetLanguage}<< {message}"
|
28 |
-
response= client.
|
29 |
-
|
30 |
-
max_new_tokens=100
|
31 |
-
|
32 |
-
|
33 |
)
|
34 |
|
35 |
print('the response',response)
|
|
|
5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
"""
|
7 |
englishToFinnishClient = InferenceClient("Helsinki-NLP/opus-mt-en-fi")
|
8 |
+
englishToSwedishClient = InferenceClient("facebook/nllb-200-1.3B")#"facebook/nllb-200-1.3B")
|
9 |
|
10 |
|
11 |
def respond(
|
|
|
24 |
|
25 |
print("the text",message, 'the source',sourceLanguage,"the target",targetLanguage)
|
26 |
|
27 |
+
#text=f">>{targetLanguage}<< {message}"
|
28 |
+
response= client.translation(
|
29 |
+
message,
|
30 |
+
#max_new_tokens=100
|
31 |
+
tgt_lang= targetLanguage,
|
32 |
+
src_lang=sourceLanguage
|
33 |
)
|
34 |
|
35 |
print('the response',response)
|