Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 6 |
return message
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
+
|
| 4 |
+
def frenchtranslator(message, history):
|
| 5 |
+
client = InferenceClient(model="Helsinki-NLP/opus-mt-vi-en")
|
| 6 |
+
message = client.translation(message).translation_text
|
| 7 |
return message
|
| 8 |
+
|
| 9 |
+
with gr.Blocks(theme=gr.themes.Soft) as app:
|
| 10 |
+
gr.ChatInterface(fn=frenchtranslator, type="messages")
|
| 11 |
+
app.launch(debug=True, share=True)
|