File size: 922 Bytes
e8e247e
081b46f
a845f21
 
 
6f1af31
75ef19a
 
771b9c6
75ef19a
771b9c6
75ef19a
 
 
 
 
 
 
 
771b9c6
ec7540b
75ef19a
771b9c6
 
 
 
 
 
 
b934ee9
182a838
771b9c6
 
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
26
27
28
29
30
31
32
33
import gradio as gr

# Define a function that echoes the input text
def echo_text(input_text):
    return input_text

custom_css = """
    .gr-textbox {
        background-color: rgb(79, 129, 145);
        color: #333;
        font-size: 30px;
        border: 2px solid #666;
        padding: 10px;
    }
    .gr-textbox:focus {
        border: 2px solid #009688;
    }
"""

# Create a Gradio interface with input above output
iface = gr.Interface(
    fn=echo_text,
    inputs=gr.Textbox(text="Enter text here..."),  # Text input field
    outputs=gr.Column(  # Create a column layout for input and output
        gr.Textbox(text="Input Text:", output=False),  # Display input text above output
        gr.Textbox(text="Output Text:", output=True),  # Display output text
        layout="rows"  # Arrange input and output in a vertical column
    ),
    live=True
)

# Launch the Gradio interface
iface.launch(share=True)