cocoat commited on
Commit
48c2262
·
verified ·
1 Parent(s): cb23532

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -41,17 +41,17 @@ history = []
41
 
42
  def make_html_table(caption):
43
  rows = caption.split("\n")
44
- # html = '<table style="width:100%;border-collapse:collapse;background:#fffaf1;color:#000">'
45
  html = ''
46
  for row in rows:
47
  if ": " in row:
48
  key, val = row.split(": ", 1)
49
  html += (
50
- f'{key}: {val}\n'
51
- # f'<tr><th style="text-align:left;border:1px solid #ddd;padding:4px;">{key}</th>'
52
- # f'<td style="border:1px solid #ddd;padding:4px;">{val}</td></tr>'
53
  )
54
- html = ''
55
  return html
56
 
57
  def update_history(img, gallery_items):
@@ -142,6 +142,11 @@ html, .gradio-container, .dark, .dark * {
142
  padding: 10px;
143
  border-radius: 12px;
144
  }
 
 
 
 
 
145
  .gradio-spinner { display: none !important; }
146
  #custom-loader {
147
  align-items: center;
@@ -277,7 +282,7 @@ window.addEventListener('load', () => {
277
  </script>
278
  """
279
  )
280
- img_out = gr.Image()
281
  state = gr.State([])
282
  history_gallery = gr.Gallery(
283
  label="生成履歴",
 
41
 
42
  def make_html_table(caption):
43
  rows = caption.split("\n")
44
+ html = '<table style="width:100%;border-collapse:collapse;background:#fffaf1;color:#000">'
45
  html = ''
46
  for row in rows:
47
  if ": " in row:
48
  key, val = row.split(": ", 1)
49
  html += (
50
+ # f'{key}: {val}\n'
51
+ f'<tr><th style="text-align:left;border:1px solid #ddd;padding:4px;">{key}</th>'
52
+ f'<td style="border:1px solid #ddd;padding:4px;">{val}</td></tr>'
53
  )
54
+ html += '</table>'
55
  return html
56
 
57
  def update_history(img, gallery_items):
 
142
  padding: 10px;
143
  border-radius: 12px;
144
  }
145
+ .gr-gallery .gallery-item Figcaption,
146
+ .gr-gallery .gallery-item figcaption {
147
+ width:420px !important;
148
+ word-wrap:break-word !important;
149
+ }
150
  .gradio-spinner { display: none !important; }
151
  #custom-loader {
152
  align-items: center;
 
282
  </script>
283
  """
284
  )
285
+ img_out = gr.Image(interactive=None)
286
  state = gr.State([])
287
  history_gallery = gr.Gallery(
288
  label="生成履歴",