philipp-zettl commited on
Commit
153ec16
·
verified ·
1 Parent(s): 68a79d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -36,7 +36,8 @@ def generate(prompt):
36
  filename = f'moves-{pgn}.svg'
37
  with open(filename, 'w') as f:
38
  f.write(img)
39
- return pgn, filename
 
40
 
41
 
42
  with gr.Blocks() as demo:
@@ -50,7 +51,7 @@ with gr.Blocks() as demo:
50
  """)
51
  prompt = gr.Text(label="PGN")
52
  output = gr.Text(label="Next turn", interactive=False)
53
- img = gr.Image(width=500, height=500)
54
  submit = gr.Button("Submit")
55
  submit.click(generate, [prompt], [output, img])
56
 
 
36
  filename = f'moves-{pgn}.svg'
37
  with open(filename, 'w') as f:
38
  f.write(img)
39
+ plot = f'<img src="{filename}">'
40
+ return pgn, plot
41
 
42
 
43
  with gr.Blocks() as demo:
 
51
  """)
52
  prompt = gr.Text(label="PGN")
53
  output = gr.Text(label="Next turn", interactive=False)
54
+ img = gr.Markdown()
55
  submit = gr.Button("Submit")
56
  submit.click(generate, [prompt], [output, img])
57