import gradio as gr | |
# Define the examples | |
examples = [ | |
["в 2006-2010 гг. Вася учился в МГУ"], | |
["я купил iphone 10X за 14990 руб без 3-x часов полдень и т.д."] | |
] | |
# Load the model with arguments including max_length | |
model = gr.load("models/alexue4/text-normalization-ru-new", | |
src="https://huggingface.co/alexue4/text-normalization-ru-new", | |
description="A model for text normalization in Russian", | |
max_length=512) | |
# Create the Gradio interface | |
interface = gr.Interface( | |
fn=model, # The model function to call | |
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter text here..."), # Input type | |
outputs="text", # Output type | |
examples=examples # Examples to display | |
) | |
# Launch the interface | |
interface.launch() | |