Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
model, while '6B' represents the number of trainable parameters. \
|
| 8 |
-
To use it, simply add your text, or click one of the examples to load them. \
|
| 9 |
-
I've used the API on this Space to deploy the GPT-J-6B model on a Telegram bot. \
|
| 10 |
-
Link to blog post below 👇"
|
| 11 |
-
|
| 12 |
-
article = "<p style='text-align: center'> \
|
| 13 |
-
<a href='https://dicksonneoh.com/portfolio/deploy_gpt_hf_models_on_telegram/' \
|
| 14 |
-
target='_blank'>Blog post</a></p>"
|
| 15 |
-
|
| 16 |
-
examples = [
|
| 17 |
-
['The tower is 324 metres (1,063 ft) tall,'],
|
| 18 |
-
["The Moon's orbit around Earth has"],
|
| 19 |
-
["The smooth Borealis basin in the Northern Hemisphere covers 40%"]
|
| 20 |
-
]
|
| 21 |
-
|
| 22 |
-
gr.Interface.load("huggingface/EleutherAI/gpt-j-6B",
|
| 23 |
-
inputs=gr.inputs.Textbox(lines=5, label="Input Text"),
|
| 24 |
-
title=title,description=description,
|
| 25 |
-
article=article,
|
| 26 |
-
examples=examples,
|
| 27 |
-
enable_queue=True).launch()
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es")
|
| 5 |
|
| 6 |
+
demo = gr.Interface.from_pipeline(pipe)
|
| 7 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|