Spaces:
Sleeping
Sleeping
Download app.py from veetla/test_space: direct link, hf CLI and curl.
- Browser
- Download file 316 Bytes
-
https://huggingface.co/spaces/veetla/test_space/resolve/main/app.py
- Command line
-
hf download hf://spaces/veetla/test_space/app.py
-
curl -L -o app.py https://huggingface.co/spaces/veetla/test_space/resolve/main/app.py
316 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-es") | |
| def predict(text): | |
| return pipe(text)[0]["translation_text"] | |
| iface = gr.Interface( | |
| fn=predict, | |
| inputs='text', | |
| outputs='text', | |
| examples=[["Hello! My name is Omar"]] | |
| ) | |
| iface.launch() |