Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
·
66774ee
1
Parent(s):
16eaa95
editing placeholder debug
Browse files
app.py
CHANGED
@@ -84,9 +84,9 @@ 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=True):
|
88 |
# Pick 10 random UI items
|
89 |
-
random_ui_items = pick_random_items(player_engagement_items,
|
90 |
|
91 |
# Generate UI and story timelines
|
92 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
@@ -611,9 +611,10 @@ with gr.Blocks() as demo:
|
|
611 |
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
612 |
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")
|
613 |
with gr.Accordion("Proto Config Assist"):
|
614 |
-
gr.Markdown("
|
615 |
-
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")
|
616 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
|
|
|
|
|
617 |
with gr.Accordion("JSON with no edits"):
|
618 |
with gr.Row():
|
619 |
timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
@@ -623,13 +624,15 @@ with gr.Blocks() as demo:
|
|
623 |
game_structure_output_text_with_media = gr.Code(language="json")
|
624 |
game_structure_output_text = gr.Code(language="json")
|
625 |
|
|
|
|
|
|
|
626 |
generate_button = gr.Button("Generate Story and Timeline")
|
627 |
-
gr.HTML("Editing placeholder")
|
628 |
@gr.render(inputs=game_structure_output_text_with_media)
|
629 |
def update(game_structure_output_text_with_media):
|
630 |
return show_elements_json_input(game_structure_output_text_with_media)
|
631 |
|
632 |
-
generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output_with_assets, timeline_output, story_output, game_structure_output_text_with_media, game_structure_output_text])
|
633 |
|
634 |
gr.HTML("Splits by new line - The idea here was to allow for saving the file ")
|
635 |
input_text = gr.Textbox(label="Input Text", lines=10)
|
|
|
84 |
story.append(f"The player interacted with {entry[2]}.")
|
85 |
return " ".join(story)
|
86 |
|
87 |
+
def generate_story_and_timeline(no_timeline_points=10, include_media=True):
|
88 |
# Pick 10 random UI items
|
89 |
+
random_ui_items = pick_random_items(player_engagement_items, no_timeline_points)
|
90 |
|
91 |
# Generate UI and story timelines
|
92 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
|
|
611 |
gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
|
612 |
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")
|
613 |
with gr.Accordion("Proto Config Assist"):
|
614 |
+
gr.Markdown("Editing placeholder")
|
|
|
615 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
|
616 |
+
gr.Markdown("# Story and Timeline Generator")
|
617 |
+
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")
|
618 |
with gr.Accordion("JSON with no edits"):
|
619 |
with gr.Row():
|
620 |
timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
|
|
|
624 |
game_structure_output_text_with_media = gr.Code(language="json")
|
625 |
game_structure_output_text = gr.Code(language="json")
|
626 |
|
627 |
+
with gr.Row():
|
628 |
+
generate_no_timeline_points = gr.Slider(minimum=3, value=10, label="Choose the amount of timeline points")
|
629 |
+
generate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
|
630 |
generate_button = gr.Button("Generate Story and Timeline")
|
|
|
631 |
@gr.render(inputs=game_structure_output_text_with_media)
|
632 |
def update(game_structure_output_text_with_media):
|
633 |
return show_elements_json_input(game_structure_output_text_with_media)
|
634 |
|
635 |
+
generate_button.click(generate_story_and_timeline, inputs=[generate_no_timeline_points, generate_with_media_check], outputs=[timeline_output_with_assets, timeline_output, story_output, game_structure_output_text_with_media, game_structure_output_text])
|
636 |
|
637 |
gr.HTML("Splits by new line - The idea here was to allow for saving the file ")
|
638 |
input_text = gr.Textbox(label="Input Text", lines=10)
|