Spaces:
Runtime error
Runtime error
kwabs22
commited on
Commit
·
ec2dcdb
1
Parent(s):
0e03629
Trying to simplify
Browse files
app.py
CHANGED
|
@@ -533,43 +533,43 @@ initgameinfo = start_game()
|
|
| 533 |
with gr.Blocks() as demo:
|
| 534 |
gr.HTML("Main ideas for this space is (June 2024): <br>A program exist around data <br>We can generate almost any media data and more <br>llms good at short questions <br>Time moves in a straight so all considerations are flattend by the nature of time <br>HF + Gradio allows for api use so this my prototype tool for tool use test")
|
| 535 |
with gr.Tab("Skeleton Generator"):
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
-
|
| 564 |
-
|
| 565 |
-
|
| 566 |
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
|
| 571 |
-
|
| 572 |
-
|
| 573 |
with gr.Tab("Test Example State Machine"):
|
| 574 |
with gr.Tab("Config Without Assets"):
|
| 575 |
with gr.Row():
|
|
@@ -577,7 +577,6 @@ with gr.Blocks() as demo:
|
|
| 577 |
gr.Markdown("# Text-based Adventure Game")
|
| 578 |
|
| 579 |
description = gr.Textbox(label="Current Situation", lines=4, value=initgameinfo[0])
|
| 580 |
-
media = gr.HTML("Placeholder to load all media tests")
|
| 581 |
choices = gr.Radio(label="Your Choices", choices=initgameinfo[1])
|
| 582 |
submit_btn = gr.Button("Make Choice")
|
| 583 |
game_log = gr.Textbox(label="Game Log", lines=20, value=initgameinfo[2])
|
|
@@ -777,6 +776,9 @@ with gr.Blocks() as demo:
|
|
| 777 |
gr.Video(value="testmedia/SVD - random squiggles as roads video 004484.mp4")
|
| 778 |
gr.Audio(value="testmedia/Stable Audio - Raindrops, output.wav")
|
| 779 |
gr.HTML("""
|
|
|
|
|
|
|
|
|
|
| 780 |
<div style="display: flex; justify-content: space-between; margin-bottom: 20px;">
|
| 781 |
<div style="width: 30%;">
|
| 782 |
<img src="testmedia/Flash scribble SDXL - random squiggles as roads.webp" alt="Random squiggles as roads" style="width: 100%; height: auto;">
|
|
@@ -794,9 +796,6 @@ with gr.Blocks() as demo:
|
|
| 794 |
</audio>
|
| 795 |
</div>
|
| 796 |
</div>
|
| 797 |
-
<div>
|
| 798 |
-
<p>This is a placeholder to test use as an all-media loader for ease of prototyping.</p>
|
| 799 |
-
</div>
|
| 800 |
""")
|
| 801 |
|
| 802 |
demo.launch()
|
|
|
|
| 533 |
with gr.Blocks() as demo:
|
| 534 |
gr.HTML("Main ideas for this space is (June 2024): <br>A program exist around data <br>We can generate almost any media data and more <br>llms good at short questions <br>Time moves in a straight so all considerations are flattend by the nature of time <br>HF + Gradio allows for api use so this my prototype tool for tool use test")
|
| 535 |
with gr.Tab("Skeleton Generator"):
|
| 536 |
+
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
| 537 |
+
gr.HTML("One prompt to be used to test models - <br>Please make 10 python lists for the types of media files and their purposes in a game and then use those lists to random generate a timeline of 20 items when the function is called <br>Great next suggest ways to improve this function to create better timelines")
|
| 538 |
+
# with gr.Tab("Generate Timeline"):
|
| 539 |
+
# with gr.Tab("Asset generation considered"):
|
| 540 |
+
# gr.HTML("Iframes are a placeholder for sample assets")
|
| 541 |
+
|
| 542 |
+
# with gr.Tab("Prototype for finegrained editing of time line before conversion to game format"):
|
| 543 |
+
with gr.Row():
|
| 544 |
+
gr.Textbox(value=timeline_with_media, lines=4)
|
| 545 |
+
gr.Textbox(value=timeline_without_media, lines=4)
|
| 546 |
+
gr.HTML("Splits by new line")
|
| 547 |
+
input_text = gr.Textbox(label="Input Text", lines=10)
|
| 548 |
+
output_group = gr.Group()
|
| 549 |
+
|
| 550 |
+
@gr.render(inputs=input_text)
|
| 551 |
+
def update(text):
|
| 552 |
+
return show_elements(text)
|
| 553 |
+
# with gr.Tab("Conversion of game version"):
|
| 554 |
+
gr.HTML("Can copy in the Test Example State Machine tab - only linear path for now")
|
| 555 |
+
media_checkbox = gr.Checkbox(label="Include Media")
|
| 556 |
+
output_text = gr.Code(language="json")
|
| 557 |
+
|
| 558 |
+
media_checkbox.change(
|
| 559 |
+
fn=show_game_structure,
|
| 560 |
+
inputs=[media_checkbox],
|
| 561 |
+
outputs=[output_text]
|
| 562 |
+
)
|
| 563 |
+
# with gr.Tab("Without Asset generation consideration"):
|
| 564 |
+
gr.Markdown("# Story and Timeline Generator")
|
| 565 |
+
gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events. <br>Ask an LLM to use this to write a story around")
|
| 566 |
|
| 567 |
+
with gr.Row():
|
| 568 |
+
timeline_output = gr.Textbox(label="Timeline", lines=20)
|
| 569 |
+
story_output = gr.Textbox(label="Generated Story", lines=20)
|
| 570 |
|
| 571 |
+
generate_button = gr.Button("Generate Story and Timeline")
|
| 572 |
+
generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output, story_output])
|
| 573 |
with gr.Tab("Test Example State Machine"):
|
| 574 |
with gr.Tab("Config Without Assets"):
|
| 575 |
with gr.Row():
|
|
|
|
| 577 |
gr.Markdown("# Text-based Adventure Game")
|
| 578 |
|
| 579 |
description = gr.Textbox(label="Current Situation", lines=4, value=initgameinfo[0])
|
|
|
|
| 580 |
choices = gr.Radio(label="Your Choices", choices=initgameinfo[1])
|
| 581 |
submit_btn = gr.Button("Make Choice")
|
| 582 |
game_log = gr.Textbox(label="Game Log", lines=20, value=initgameinfo[2])
|
|
|
|
| 776 |
gr.Video(value="testmedia/SVD - random squiggles as roads video 004484.mp4")
|
| 777 |
gr.Audio(value="testmedia/Stable Audio - Raindrops, output.wav")
|
| 778 |
gr.HTML("""
|
| 779 |
+
<div>
|
| 780 |
+
<p>This is a placeholder to test use as an all-media loader for ease of prototyping. Seems gradio HTML doesnt support loading local assets or my file path is wrong</p>
|
| 781 |
+
</div>
|
| 782 |
<div style="display: flex; justify-content: space-between; margin-bottom: 20px;">
|
| 783 |
<div style="width: 30%;">
|
| 784 |
<img src="testmedia/Flash scribble SDXL - random squiggles as roads.webp" alt="Random squiggles as roads" style="width: 100%; height: auto;">
|
|
|
|
| 796 |
</audio>
|
| 797 |
</div>
|
| 798 |
</div>
|
|
|
|
|
|
|
|
|
|
| 799 |
""")
|
| 800 |
|
| 801 |
demo.launch()
|