Spaces:
Runtime error
Runtime error
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() | |