Spaces:
Runtime error
Runtime error
import gradio as gr | |
import torch | |
from transformers import pipeline | |
print(f'{torch.cuda.is_available()=}') | |
pipe = pipeline('translation_en_to_fr', device=0) | |
def translate(text): | |
return pipe(text)[0]['translation_text'] | |
iface = gr.Interface(fn=translate, inputs="text", outputs="text") | |
iface.launch() | |