Spaces:
Runtime error
Runtime error
Download app.py from mohelwah/multiModels: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/spaces/mohelwah/multiModels/resolve/main/app.py
- Command line
-
hf download hf://spaces/mohelwah/multiModels/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mohelwah/multiModels/resolve/main/app.py
509 Bytes
| import gradio as gr | |
| from transformers.utils import logging | |
| loggging.set_verbosity_error() | |
| from transformers import pipeline | |
| import torch | |
| translator = pipeline(task='translation', | |
| model='facebook/nllb-200-distilled-600M', | |
| torch.dtype=torch.bfloat16) | |
| def translate(text): | |
| translated_text = translator(text. src_lang='eng_Latn', tgt_lang='fra_Latn') | |
| return translated_text | |
| demo = gr.Interface(fn=greet, inputs="text", outputs="text") | |
| demo.launch() | |