File size: 525 Bytes
5896565
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import random

def generate_text(length):
    text = ""
    for i in range(length):
        text += chr(random.randint(97, 122))
    return text

input_text = gr.inputs.Slider(minimum=1, maximum=100, default=50, label="Length of Text")
output_text = gr.outputs.Textbox(label="Generated Text")

title = "Random Text Generator"
description = "Generate random text of a specified length."

gr.Interface(fn=generate_text, inputs=input_text, outputs=output_text, title=title, description=description).launch()