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