File size: 831 Bytes
932274f
 
d653395
5e13b07
 
 
 
 
d653395
 
 
 
 
1c903eb
d653395
 
 
 
 
 
 
1c903eb
d653395
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()