Commit
·
fc5ec97
1
Parent(s):
c942d32
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
-
|
4 |
-
|
|
|
5 |
def translate_gradio(input):
|
6 |
result=translation_pipeline(input)
|
7 |
return result[0]["translation_text"]
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
import os
|
4 |
+
TOKEN = os.getenv('HUGGING_FACE_HUB_TOKEN')
|
5 |
+
translator = pipeline("translation", model="barghavani/en_to_fr_translation_model",use_auth_token=TOKEN)
|
6 |
def translate_gradio(input):
|
7 |
result=translation_pipeline(input)
|
8 |
return result[0]["translation_text"]
|