Spaces:
Runtime error
Runtime error
Remove extra css styling, hide HTML output, add type hints for run function
Browse files
app.py
CHANGED
|
@@ -292,7 +292,7 @@ def html_to_png(html):
|
|
| 292 |
return img
|
| 293 |
|
| 294 |
|
| 295 |
-
def run(name):
|
| 296 |
start = time.time()
|
| 297 |
print(f'BEGINNING RUN FOR {name}')
|
| 298 |
text = gen_monster_text(name)
|
|
@@ -315,8 +315,7 @@ input_box = gr.Textbox(label="Enter a monster name", placeholder="Jabberwock")
|
|
| 315 |
output_monster_card = gr.Pil(label="Monster Card")
|
| 316 |
output_text_box = gr.Textbox(label="Monster Text")
|
| 317 |
output_monster_image = gr.Pil(label="Monster Image")
|
| 318 |
-
output_monster_html = gr.HTML(label="Monster HTML")
|
| 319 |
iface = gr.Interface(title="MonsterGen", theme="default", description=app_description, fn=run, inputs=[input_box],
|
| 320 |
-
outputs=[output_monster_card, output_text_box, output_monster_image, output_monster_html]
|
| 321 |
-
css="monstermaker.css")
|
| 322 |
iface.launch()
|
|
|
|
| 292 |
return img
|
| 293 |
|
| 294 |
|
| 295 |
+
def run(name: str) -> (Image, str, Image, str):
|
| 296 |
start = time.time()
|
| 297 |
print(f'BEGINNING RUN FOR {name}')
|
| 298 |
text = gen_monster_text(name)
|
|
|
|
| 315 |
output_monster_card = gr.Pil(label="Monster Card")
|
| 316 |
output_text_box = gr.Textbox(label="Monster Text")
|
| 317 |
output_monster_image = gr.Pil(label="Monster Image")
|
| 318 |
+
output_monster_html = gr.HTML(label="Monster HTML", show_label=False, visible=False)
|
| 319 |
iface = gr.Interface(title="MonsterGen", theme="default", description=app_description, fn=run, inputs=[input_box],
|
| 320 |
+
outputs=[output_monster_card, output_text_box, output_monster_image, output_monster_html])
|
|
|
|
| 321 |
iface.launch()
|