wall-e-zz commited on
Commit
462d7ce
1 Parent(s): 04bf315

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -7,20 +7,20 @@ def flip_text(x):
7
  def flip_image(x):
8
  return np.fliplr(x)
9
 
10
- with gr.Blocks() as demo:
11
- gr.Markdown("Flip text or image files using this demo.")
12
  with gr.Tabs():
13
- with gr.TabItem("Flip Text"):
14
- text_input = gr.Textbox()
15
- text_output = gr.Textbox()
16
- text_button = gr.Button("Flip")
17
- with gr.TabItem("Flip Image"):
18
  with gr.Row():
19
- image_input = gr.Image()
20
- image_output = gr.Image()
21
- image_button = gr.Button("Flip")
22
 
23
  text_button.click(flip_text, inputs=text_input, outputs=text_output)
24
  image_button.click(flip_image, inputs=image_input, outputs=image_output)
25
 
26
- demo.launch()
 
7
  def flip_image(x):
8
  return np.fliplr(x)
9
 
10
+ with gr.Blocks() as app:
11
+ gr.Markdown("#翻转文本或图像")
12
  with gr.Tabs():
13
+ with gr.TabItem("翻转文本"):
14
+ text_input = gr.Textbox(label="输入")
15
+ text_output = gr.Textbox(label="结果")
16
+ text_button = gr.Button("翻转")
17
+ with gr.TabItem("翻转图像"):
18
  with gr.Row():
19
+ image_input = gr.Image(label="输入")
20
+ image_output = gr.Image(label="结果")
21
+ image_button = gr.Button("翻转")
22
 
23
  text_button.click(flip_text, inputs=text_input, outputs=text_output)
24
  image_button.click(flip_image, inputs=image_input, outputs=image_output)
25
 
26
+ app.launch()