Spaces:
Runtime error
Runtime error
Add application file
Browse files- app.py +29 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
title = "umt5-base"
|
| 7 |
+
description = """
|
| 8 |
+
Task: Text2Text Generation\n
|
| 9 |
+
Trained dataset: mC4 corpus \n
|
| 10 |
+
Languages: 107 languages \n
|
| 11 |
+
Developer: Google \n
|
| 12 |
+
Paper: https://openreview.net/forum?id=kXwdL1cWOAi
|
| 13 |
+
"""
|
| 14 |
+
article = "<p style='text-align: center'><a href='https://huggingface.co/google/umt5-base' target='_blank'>google/umt5-base</a></p>"
|
| 15 |
+
|
| 16 |
+
examples=[["I am "], ["私は"], ["我是"], ["ฉันคือ"]]
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
demo =gr.load(
|
| 20 |
+
"huggingface/google/umt5-base",
|
| 21 |
+
inputs=gr.Textbox(lines=5, label="Input Text"),
|
| 22 |
+
title=title,
|
| 23 |
+
description=description,
|
| 24 |
+
article=article,
|
| 25 |
+
examples=examples,
|
| 26 |
+
theme="freddyaboulton/dracula_revamped",
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==3.36.1
|
| 2 |
+
transformers==4.30.2
|
| 3 |
+
torch==2.0.1
|