Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
•
e578809
1
Parent(s):
8eafcce
Trying to simplify Skeleton again
Browse files
app.py
CHANGED
@@ -84,7 +84,7 @@ def create_story(timeline):
|
|
84 |
story.append(f"The player interacted with {entry[2]}.")
|
85 |
return " ".join(story)
|
86 |
|
87 |
-
def generate_story_and_timeline(include_media=
|
88 |
# Pick 10 random UI items
|
89 |
random_ui_items = pick_random_items(player_engagement_items, 10)
|
90 |
|
@@ -116,7 +116,7 @@ def generate_story_and_timeline(include_media=False):
|
|
116 |
|
117 |
game_structure_with_media, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
|
118 |
|
119 |
-
return formatted_timeline, no_media_formatted_timeline, story, game_structure_with_media, game_structure_without_media
|
120 |
|
121 |
media_file_types = ["image", "video", "audio"]
|
122 |
|
@@ -473,8 +473,14 @@ initgameinfo = start_game()
|
|
473 |
#-----------------------------------------------------------------------------------------------------------------------------------
|
474 |
|
475 |
with gr.Blocks() as demo:
|
476 |
-
gr.HTML("""Main ideas for this space is (June 2024):
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
with gr.Tab("Skeleton Generator"):
|
479 |
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
480 |
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")
|
@@ -482,24 +488,24 @@ with gr.Blocks() as demo:
|
|
482 |
gr.Markdown("# Story and Timeline Generator")
|
483 |
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")
|
484 |
with gr.Row():
|
485 |
-
timeline_output_with_assets = gr.Textbox(label="Timeline", lines=20)
|
486 |
-
timeline_output = gr.Textbox(label="Timeline", lines=20)
|
487 |
-
story_output = gr.Textbox(label="Generated Story", lines=20)
|
488 |
gr.Textbox("Do all fit on same row")
|
489 |
|
490 |
generate_button = gr.Button("Generate Story and Timeline")
|
491 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now"):
|
492 |
-
media_checkbox = gr.Checkbox(label="Include Media")
|
493 |
-
|
494 |
screen_game_structure_with_media = gr.State()
|
495 |
screen_game_structure_without_media = gr.State()
|
496 |
|
497 |
media_checkbox.change(
|
498 |
fn=show_game_structure,
|
499 |
-
inputs=[media_checkbox],
|
500 |
-
outputs=[
|
501 |
)
|
502 |
-
generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output_with_assets, timeline_output, story_output, screen_game_structure_with_media, screen_game_structure_without_media])
|
503 |
# with gr.Row():
|
504 |
# gr.Textbox(value=timeline_with_media, lines=4)
|
505 |
# gr.Textbox(value=timeline_without_media, lines=4)
|
@@ -541,7 +547,7 @@ with gr.Blocks() as demo:
|
|
541 |
outputs=[error_box, game_log, description, choices, game_session, custom_config]
|
542 |
)
|
543 |
with gr.Tab("Config With Assets"):
|
544 |
-
gr.HTML("Placeholder as not complete yet (still only text)")
|
545 |
with gr.Row():
|
546 |
with gr.Column(scale=2):
|
547 |
gr.Markdown("# Text-based Adventure Game")
|
|
|
84 |
story.append(f"The player interacted with {entry[2]}.")
|
85 |
return " ".join(story)
|
86 |
|
87 |
+
def generate_story_and_timeline(include_media=True):
|
88 |
# Pick 10 random UI items
|
89 |
random_ui_items = pick_random_items(player_engagement_items, 10)
|
90 |
|
|
|
116 |
|
117 |
game_structure_with_media, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
|
118 |
|
119 |
+
return formatted_timeline, no_media_formatted_timeline, story, game_structure_with_media, game_structure_without_media, game_structure_with_media
|
120 |
|
121 |
media_file_types = ["image", "video", "audio"]
|
122 |
|
|
|
473 |
#-----------------------------------------------------------------------------------------------------------------------------------
|
474 |
|
475 |
with gr.Blocks() as demo:
|
476 |
+
gr.HTML("""Main ideas for this space is (June 2024):
|
477 |
+
<div style="display: flex; justify-content: space-between; margin-bottom: 20px; text-align: center;">
|
478 |
+
<div style="width: 20%;">A program exist around data </div>
|
479 |
+
<div style="width: 20%;">We can generate almost any media data and more </div>
|
480 |
+
<div style="width: 20%;">llms good at short questions </div>
|
481 |
+
<div style="width: 20%;">Time moves in a straight so all considerations are flattend by the nature of time </div>
|
482 |
+
<div style="width: 20%;">HF + Gradio allows for api use so this my prototype tool for tool use test</div>
|
483 |
+
</div>""")
|
484 |
with gr.Tab("Skeleton Generator"):
|
485 |
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
486 |
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")
|
|
|
488 |
gr.Markdown("# Story and Timeline Generator")
|
489 |
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")
|
490 |
with gr.Row():
|
491 |
+
timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
492 |
+
timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
|
493 |
+
story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
|
494 |
gr.Textbox("Do all fit on same row")
|
495 |
|
496 |
generate_button = gr.Button("Generate Story and Timeline")
|
497 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now"):
|
498 |
+
media_checkbox = gr.Checkbox(label="Include Media", value=True)
|
499 |
+
game_structure_output_text = gr.Code(language="json")
|
500 |
screen_game_structure_with_media = gr.State()
|
501 |
screen_game_structure_without_media = gr.State()
|
502 |
|
503 |
media_checkbox.change(
|
504 |
fn=show_game_structure,
|
505 |
+
inputs=[media_checkbox, screen_game_structure_with_media, screen_game_structure_without_media],
|
506 |
+
outputs=[game_structure_output_text]
|
507 |
)
|
508 |
+
generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output_with_assets, timeline_output, story_output, screen_game_structure_with_media, screen_game_structure_without_media, game_structure_output_text])
|
509 |
# with gr.Row():
|
510 |
# gr.Textbox(value=timeline_with_media, lines=4)
|
511 |
# gr.Textbox(value=timeline_without_media, lines=4)
|
|
|
547 |
outputs=[error_box, game_log, description, choices, game_session, custom_config]
|
548 |
)
|
549 |
with gr.Tab("Config With Assets"):
|
550 |
+
gr.HTML("Placeholder as not complete yet (still only text, current issue is how to switch gradio output, maybe output is gr.Group and we constantly add the appropriate gr for each file type? What about multi file types on one state?)")
|
551 |
with gr.Row():
|
552 |
with gr.Column(scale=2):
|
553 |
gr.Markdown("# Text-based Adventure Game")
|