MenaWANG commited on
Commit
24ddb11
1 Parent(s): 117a2bd

recreate app.py

Browse files

Delete and recreate app.py to get rid of the "No application file" error

Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import transformers
3
+
4
+ def translate_with_prefix(English):
5
+ prefix = "Translate English to Latin: "
6
+ translator = transformers.pipeline("translation", model="AlbertY123/translator-en-la")
7
+ return translator(prefix + English)
8
+
9
+ iface = gr.Interface(fn=translate_with_prefix,
10
+ inputs="text",
11
+ outputs="text"
12
+ , title="English to Latin Translator"
13
+ )
14
+
15
+ if __name__ == "__main__":
16
+ iface.launch()
17
+