research14 commited on
Commit
771b9c6
·
1 Parent(s): 75ef19a

layout change

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -6,9 +6,9 @@ def echo_text(input_text):
6
 
7
  custom_css = """
8
  .gr-textbox {
9
- background-color: #f2f2f2;
10
  color: #333;
11
- font-size: 16px;
12
  border: 2px solid #666;
13
  padding: 10px;
14
  }
@@ -17,15 +17,17 @@ custom_css = """
17
  }
18
  """
19
 
 
20
  iface = gr.Interface(
21
  fn=echo_text,
22
- inputs=gr.Textbox(text="Enter text here...", style=custom_css),
23
- outputs=gr.Textbox(style=custom_css),
24
- live=True,
25
- title="Professional Text Echo Interface",
26
- width=500,
27
- height=200,
28
- theme="light" # You can use "dark" for a dark theme
29
  )
30
 
31
- iface.launch()
 
 
6
 
7
  custom_css = """
8
  .gr-textbox {
9
+ background-color: rgb(79, 129, 145);
10
  color: #333;
11
+ font-size: 30px;
12
  border: 2px solid #666;
13
  padding: 10px;
14
  }
 
17
  }
18
  """
19
 
20
+ # Create a Gradio interface with input above output
21
  iface = gr.Interface(
22
  fn=echo_text,
23
+ inputs=gr.Textbox(text="Enter text here..."), # Text input field
24
+ outputs=gr.Column( # Create a column layout for input and output
25
+ gr.Textbox(text="Input Text:", output=False), # Display input text above output
26
+ gr.Textbox(text="Output Text:", output=True), # Display output text
27
+ layout="rows" # Arrange input and output in a vertical column
28
+ ),
29
+ live=True
30
  )
31
 
32
+ # Launch the Gradio interface
33
+ iface.launch(share=True)