AntaresGuo commited on
Commit
dd46e6d
·
verified ·
1 Parent(s): 97dfa04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,12 +8,14 @@ from interface_modules.X2Painting.client_process import send_to_server
8
  def on_select_char(evt: gr.SelectData):
9
  index = evt.index
10
  style_name = list(style_example.values())[index]
 
11
  return gr.update(value=style_name)
12
 
13
 
14
  def on_select_word(evt: gr.SelectData):
15
  index = evt.index
16
  style_name = list(style_example_word.values())[index]
 
17
  return gr.update(value=style_name)
18
 
19
 
@@ -81,7 +83,7 @@ with gr.Blocks(css=css) as demo:
81
  """)
82
  example_gallery_char = gr.Gallery(label="style_type_char", show_label=True,
83
  elem_id="example_gallery_char",
84
- value=list(style_example.keys()), columns=10
85
  )
86
  # vis result gallery
87
  gr.HTML("""
@@ -131,7 +133,6 @@ with gr.Blocks(css=css) as demo:
131
  value=list(style_example_word.keys()), columns=5,
132
  allow_preview=True, selected_index=0,
133
  preview=True,
134
- object_fit="scale-down",
135
  )
136
  # vis result gallery
137
  gr.HTML("""
@@ -143,7 +144,6 @@ with gr.Blocks(css=css) as demo:
143
  elem_classes="final_gallery", columns=1,
144
  allow_preview=True, selected_index=0,
145
  preview=True,
146
- object_fit="scale-down",
147
  )
148
 
149
  submit_word.add([final_gallery_word])
 
8
  def on_select_char(evt: gr.SelectData):
9
  index = evt.index
10
  style_name = list(style_example.values())[index]
11
+ print("char style:", style_name)
12
  return gr.update(value=style_name)
13
 
14
 
15
  def on_select_word(evt: gr.SelectData):
16
  index = evt.index
17
  style_name = list(style_example_word.values())[index]
18
+ print("word style:",style_name)
19
  return gr.update(value=style_name)
20
 
21
 
 
83
  """)
84
  example_gallery_char = gr.Gallery(label="style_type_char", show_label=True,
85
  elem_id="example_gallery_char",
86
+ value=list(style_example.keys()), columns=5
87
  )
88
  # vis result gallery
89
  gr.HTML("""
 
133
  value=list(style_example_word.keys()), columns=5,
134
  allow_preview=True, selected_index=0,
135
  preview=True,
 
136
  )
137
  # vis result gallery
138
  gr.HTML("""
 
144
  elem_classes="final_gallery", columns=1,
145
  allow_preview=True, selected_index=0,
146
  preview=True,
 
147
  )
148
 
149
  submit_word.add([final_gallery_word])