Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
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.
|
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 |
|