Spaces:
Sleeping
Sleeping
recreate app.py
Browse filesDelete and recreate app.py to get rid of the "No application file" error
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 |
+
|