Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
pipeline = pipeline(task="
|
| 5 |
|
| 6 |
def predict(image):
|
| 7 |
predictions = pipeline(image)
|
|
@@ -9,7 +9,7 @@ def predict(image):
|
|
| 9 |
|
| 10 |
gr.Interface(
|
| 11 |
predict,
|
| 12 |
-
inputs=gr.inputs.
|
| 13 |
outputs=gr.outputs.Label(num_top_classes=2),
|
| 14 |
-
title="
|
| 15 |
).launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
pipeline = pipeline(task="translation", model="bigscience/bloom-350m")
|
| 5 |
|
| 6 |
def predict(image):
|
| 7 |
predictions = pipeline(image)
|
|
|
|
| 9 |
|
| 10 |
gr.Interface(
|
| 11 |
predict,
|
| 12 |
+
inputs=gr.inputs.Text(label="Write text", type="filepath"),
|
| 13 |
outputs=gr.outputs.Label(num_top_classes=2),
|
| 14 |
+
title="Translation",
|
| 15 |
).launch()
|