Translator / gradio.File
Taghrid's picture
Upload folder using huggingface_hub
870b562 verified
raw
history blame contribute delete
470 Bytes
import logging
import gradio as gr
from model import Translator
model_path = 'model.h5'
model = Translator(model_path)
logging.basicConfig(level=logging.INFO)
def translate_sentence(input_sentence):
return model.predict(input_sentence)
inputs = gr.Textbox(lines=2, label="Input Text")
outputs = gr.Textbox(lines=4, label="Translated Text")
gr.Interface(
fn=translate_sentence,
inputs=inputs,
outputs=outputs,
allow_flagging="never"
).launch()