kwabs22 commited on
Commit
f49bae8
·
1 Parent(s): 10681c7

Story craft UI complexities removed?

Browse files
Files changed (2) hide show
  1. app.py +60 -103
  2. relatively_constant_variables.py +6 -7
app.py CHANGED
@@ -754,10 +754,24 @@ with gr.Blocks() as demo:
754
  </div>""")
755
 
756
  with gr.Accordion("Config and Asset Assistance - Click to open", open=False):
757
- gr.HTML("Current Assited workflow idea - Story timeline events suggestions | Merging events with premade mermaid structures | Edit mermaid till satisfied | Ask LLM to convert to config | Edit config | Playtest and go back to mermaaid or config if there are problems")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  with gr.Accordion("Qwen 0.5B as Space Guide Tests", open=False):
759
  with gr.Tab("General FAQ Attempt"):
760
- FAQMainOutput = gr.TextArea(placeholder='Output will show here')
761
  FAQCustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
762
 
763
  for category_name, category_prompts in FAQAllprompts.items():
@@ -770,21 +784,6 @@ with gr.Blocks() as demo:
770
  with gr.Tab("General RAG (Pathfinder?) Attempt"):
771
  gr.HTML("https://huggingface.co/spaces/mteb/leaderboard - Source for SOTA - current using all-MiniLM-L6-v2")
772
  gr.HTML("Placeholder for weak RAG Type Charcter interaction test aka input for JSON 'Knowledge Base' Input")
773
- # gr.Interface(
774
- # fn=rag,
775
- # inputs=[
776
- # gr.Textbox(lines=2, placeholder="Enter your question here..."),
777
- # gr.Checkbox(label="Stream output")
778
- # ],
779
- # outputs=[
780
- # gr.Textbox(label="Generated Response"),
781
- # gr.Textbox(label="Tokens per second"),
782
- # gr.Textbox(label="Resource Usage")
783
- # ],
784
- # title="RAG Q&A System with GPU Acceleration and Resource Monitoring",
785
- # description="Ask a question and get an answer based on the retrieved context. The response is generated using a GPU-accelerated model. Resource usage is logged at the end of generation."
786
- # )
787
-
788
  gr.Interface(
789
  fn=process_query,
790
  inputs=[
@@ -835,93 +834,51 @@ with gr.Blocks() as demo:
835
  with gr.Accordion("Mermaid Structures - click to open", open=False):
836
  for key, item in mermaidstorystructures.items():
837
  gr.Code(item, label=key)
838
- #gr.Code(value=mermaidstorystructures['Parallel Storylines Progression'])
839
- with gr.Tab("Timeline Guide for Config Generation or evelution"):
840
- with gr.Accordion("Empty Config shape for explaining to LLM", open=False):
841
- gr.HTML(f"placeholder for current empty JSON config shape")
842
- gr.HTML("Structural indicators of quality of config")
843
- with gr.Tab("Random Suggestions"):
844
- # timeline_num_lists_slider = gr.Slider(minimum=1, maximum=len(all_idea_lists), step=1, label="Number of Lists to Consider", value=3)
845
- # timeline_items_per_list_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Items per List", value=3)
846
- # timeline_generate_button = gr.Button("Generate Random Suggestions")
847
- # timeline_output_text = gr.Textbox(label="Random Suggestions", lines=10)
848
-
849
- # timeline_generate_button.click(
850
- # timeline_get_random_suggestions,
851
- # inputs=[timeline_num_lists_slider, timeline_items_per_list_slider],
852
- # outputs=[timeline_output_text]
853
- # )
854
- timeline_num_lists_slider = gr.Slider(minimum=1, maximum=len(all_idea_lists), step=1, label="Number of Lists to Consider", value=3)
855
- timeline_items_per_list_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Items per List", value=3)
856
- timeline_include_existing_games = gr.Checkbox(label="Include Existing Game Inspirations", value=True)
857
- timeline_include_multiplayer = gr.Checkbox(label="Include Multiplayer Features", value=True)
858
- timeline_generate_button = gr.Button("Generate Random Suggestions")
859
- timeline_output_text = gr.Textbox(label="Random Suggestions", lines=10)
860
- timeline_selected_lists_text = gr.Textbox(label="Selected Lists", lines=2)
861
-
862
- timeline_generate_button.click(
863
- timeline_get_random_suggestions,
864
- inputs=[timeline_num_lists_slider, timeline_items_per_list_slider, timeline_include_existing_games, timeline_include_multiplayer],
865
- outputs=[timeline_output_text, timeline_selected_lists_text]
866
- )
867
- with gr.Tab("Config Specific"):
868
- gr.HTML("Timeline for making Timelines?")
869
- gr.HTML("Componets (outside Code Support for Config): Decisions (and context explanation), Nested Sections, Media (Especially to affect decisions), Replayability (GTA and Tekken type mechanics in text form), Theme integration (Modified Varibles that affect UI or config order)")
870
- gr.HTML("From Nothing <br>")
871
- gr.HTML("From Existing <br>")
872
- with gr.Tab("Existing Game Analysis"):
873
- gr.HTML("Existing Games eg. GTA Heists - Same Map with overlapping branching narratives, Battlefront - Elites amongst Commoners, Tekken Casino (one mistake = 1/2 or 1/3 of your Resources) and Turn based: 'Tactics' type nintendo games, Chess (and any other tile based game) ")
874
- gr.HTML("Existing Game Rules for text - Cyberpunk RED, ")
875
- with gr.Tab("Multiplayer options"):
876
- gr.HTML("Community playthrough = Tally of players choices, Random item placed in a random location - first person to get it wins, Survival by location or characters met")
877
- with gr.Tab("Some Workflow Helpers (Removed as built into Semi-Auto)"):
878
- gr.HTML("Song / Random Scenario to 'full game' manual or auto is end goal ")
879
- gr.HTML("Main Priority is to make rails for the story to work on as a simplified view of a game is a linear path with loops (gameplay mechanics) <br> Below = Manual Edit (At bottom you can save the changes and copy it to test) <br>For LLM edit copy either the Timeline")
880
- gr.HTML("The problem is the assets generation isnt free and using spaces as api also clogs them (no way to know when ZeroGPUs are at lowest usage) so using iFrame is better for now <br> So worklfow -- Make Skeleton -- Use Iframe to get media -- then ask for details / story / gameplay loop ideas and add back to config")
881
- with gr.Tab("Schema First"):
882
- gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
883
- 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")
884
- with gr.Accordion("Test for config to gradio components order - ignore for now", open=False ):
885
- gr.Markdown("Asset Generation")
886
- gr.HTML("Splits by new line - The idea here was to allow for saving the file ")
887
- input_text = gr.Textbox(label="Input Text", lines=10)
888
- output_group = gr.Group()
889
-
890
- @gr.render(inputs=input_text)
891
- def update(text):
892
- return show_elements(text)
893
- with gr.Accordion("Proto Config Assist"):
894
- with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
895
- gr.Markdown("# Story and Timeline Generator")
896
- 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")
897
- with gr.Row():
898
- game_structure_output_text_with_media = gr.Code(language="json")
899
- game_structure_output_text = gr.Code(language="json")
900
- with gr.Accordion("JSON with no edits"):
901
- with gr.Row():
902
- timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
903
- timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
904
- story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
905
  with gr.Row():
906
- generate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
907
- generate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
908
- generate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
909
- generate_button = gr.Button("Generate Story and Timeline")
910
-
911
- @gr.render(inputs=game_structure_output_text_with_media)
912
- def update(game_structure_output_text_with_media):
913
- return show_elements_json_input(game_structure_output_text_with_media)
914
-
915
- generate_button.click(generate_story_and_timeline, inputs=[generate_no_ui_timeline_points, generate_no_media_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])
916
-
917
- with gr.Tab("Asset First"):
918
- gr.HTML("Make Asset and make the transitions using LLM")
919
-
920
- with gr.Tab("Export Options"):
921
- gr.HTML("Placeholder - My Custom JS, Playcanvas, Unreal Engine")
922
-
923
- with gr.Tab("Config Writing Considerations"):
924
- gr.HTML("Player Stats, Inventory and NPCS not implemented yet, so traversal type games best aka graph like structures <br> Game is like a universal translator so any concept can be covered")
925
 
926
  with gr.Accordion("Existing Config Crafting Progression - click to open", open=False):
927
  with gr.Tab("Quick Ways to evaluate current config"):
 
754
  </div>""")
755
 
756
  with gr.Accordion("Config and Asset Assistance - Click to open", open=False):
757
+ gr.HTML("Current Assited workflow idea - Story timeline events suggestions (LLM / Premade List) | Merging events with premade mermaid structures (LLM + Story Text + Mermaid Text) | Edit mermaid till satisfied (LLM + Story Text) | Ask LLM to convert to config (LLM + JSON Text) | Edit config (LLM / User with format assistance or not) | Playtest and go back to mermaaid or config if there are problems")
758
+ gr.HTML("Interactive movie (UI interaction or no progress) vs Branching Paths (Maze)")
759
+ gr.HTML("Things that can change the workflow - Asset First (Make Asset and make the transitions using LLM), Export First (Custom JS config, Playcanvas, Unreal Engine reverse engineered to this spaces config?) Game Mechanics First (eg. Player Stats, Inventory and NPCS not implemented yet, so traversal type games best aka graph like structures)")
760
+ with gr.Accordion("Old Ideas to merge"):
761
+ gr.HTML("Random Scenario / Song to 'full game' manual or auto is end goal ")
762
+ gr.HTML("Main Priority is to make rails for the story to work on as a simplified view of a game is a linear path with loops (gameplay mechanics) <br> Below = Manual Edit (At bottom you can save the changes and copy it to test) <br>For LLM edit copy either the Timeline")
763
+ gr.HTML("The problem is the assets generation is slow and using spaces as api can also clog them (I dont know how to check when ZeroGPUs are at lowest usage historically) so using iFrame is better for now <br> So worklfow -- Make Skeleton -- Use Iframe to get media -- then ask for details / story / gameplay loop ideas and add back to config")
764
+ gr.HTML("Timeline for making Timelines?")
765
+ gr.HTML("Componets (outside Code Support for Config): Decisions (and context explanation), Nested Sections, Media (Especially to affect decisions), Replayability (GTA and Tekken type mechanics in text form), Theme integration (Modified Varibles that affect UI or config order)")
766
+ gr.HTML("Existing Games eg. GTA Heists - Same Map with overlapping branching narratives, Battlefront - Elites amongst Commoners, Tekken Casino (one mistake = 1/2 or 1/3 of your Resources) and Turn based: 'Tactics' type nintendo games, Chess (and any other tile based game) ")
767
+ gr.HTML("Existing Game Rules for text - Cyberpunk RED, ")
768
+ gr.HTML("Community playthrough = Tally of players choices, Random item placed in a random location - first person to get it wins, Survival by location or characters met")
769
+ gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
770
+ 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")
771
+
772
  with gr.Accordion("Qwen 0.5B as Space Guide Tests", open=False):
773
  with gr.Tab("General FAQ Attempt"):
774
+ FAQMainOutput = gr.TextArea(placeholder='Output will show here', value='')
775
  FAQCustomButtonInput = gr.TextArea(lines=1, placeholder='Prompt goes here')
776
 
777
  for category_name, category_prompts in FAQAllprompts.items():
 
784
  with gr.Tab("General RAG (Pathfinder?) Attempt"):
785
  gr.HTML("https://huggingface.co/spaces/mteb/leaderboard - Source for SOTA - current using all-MiniLM-L6-v2")
786
  gr.HTML("Placeholder for weak RAG Type Charcter interaction test aka input for JSON 'Knowledge Base' Input")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
787
  gr.Interface(
788
  fn=process_query,
789
  inputs=[
 
834
  with gr.Accordion("Mermaid Structures - click to open", open=False):
835
  for key, item in mermaidstorystructures.items():
836
  gr.Code(item, label=key)
837
+ timeline_num_lists_slider = gr.Slider(minimum=1, maximum=len(all_idea_lists), step=1, label="Number of Lists to Consider", value=3)
838
+ timeline_items_per_list_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Items per List", value=3)
839
+ timeline_include_existing_games = gr.Checkbox(label="Include Existing Game Inspirations", value=True)
840
+ timeline_include_multiplayer = gr.Checkbox(label="Include Multiplayer Features", value=True)
841
+ timeline_generate_button = gr.Button("Generate Random Suggestions")
842
+ timeline_output_text = gr.Textbox(label="Random Suggestions", lines=10)
843
+ timeline_selected_lists_text = gr.Textbox(label="Selected Lists", lines=2)
844
+
845
+ timeline_generate_button.click(
846
+ timeline_get_random_suggestions,
847
+ inputs=[timeline_num_lists_slider, timeline_items_per_list_slider, timeline_include_existing_games, timeline_include_multiplayer],
848
+ outputs=[timeline_output_text, timeline_selected_lists_text]
849
+ )
850
+ with gr.Accordion("Test for config to gradio components order - ignore for now", open=False ):
851
+ gr.Markdown("Asset Generation")
852
+ gr.HTML("Splits by new line - The idea here was to allow for saving the file ")
853
+ input_text = gr.Textbox(label="Input Text", lines=10)
854
+ output_group = gr.Group()
855
+
856
+ @gr.render(inputs=input_text)
857
+ def update(text):
858
+ return show_elements(text)
859
+ with gr.Accordion("Proto Config Assist"):
860
+ with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
861
+ gr.Markdown("# Story and Timeline Generator")
862
+ 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")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  with gr.Row():
864
+ game_structure_output_text_with_media = gr.Code(language="json")
865
+ game_structure_output_text = gr.Code(language="json")
866
+ with gr.Accordion("JSON with no edits"):
867
+ with gr.Row():
868
+ timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
869
+ timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
870
+ story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
871
+ with gr.Row():
872
+ generate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
873
+ generate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
874
+ generate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
875
+ generate_button = gr.Button("Generate Story and Timeline")
876
+
877
+ @gr.render(inputs=game_structure_output_text_with_media)
878
+ def update(game_structure_output_text_with_media):
879
+ return show_elements_json_input(game_structure_output_text_with_media)
880
+
881
+ generate_button.click(generate_story_and_timeline, inputs=[generate_no_ui_timeline_points, generate_no_media_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])
 
882
 
883
  with gr.Accordion("Existing Config Crafting Progression - click to open", open=False):
884
  with gr.Tab("Quick Ways to evaluate current config"):
relatively_constant_variables.py CHANGED
@@ -161,15 +161,14 @@ Frontendpromptengforguide = """Suggest descriptions for media to fill the empty
161
  }
162
  """
163
 
164
-
165
-
166
  FAQAllprompts = {
167
  "Example Workflow": [
168
- ("I am writing a story about a chef. please write dishes to appear on the menu.", " - I am writing a story about a chef. please write dishes to appear on the menu."),
169
  ("Lets brainstorm some decisions a chef would take", " - What are the most common decisions that a chef story would include?"),
170
  ("Lets brainstorm some problems a chef would face", " - What are the kinds problems that a chef story would include?"),
171
  ("Lets brainstorm some goals the chef would have", " - What are the kinds of out of reach goals that a chef story would include?"),
172
- ("Please help me add to config that I pasted", " - Continue the pasted config from any complete block.")
 
173
  ],
174
  "FAQ": [
175
  ("Help me make a story", "- Explain to the user that they need to come up with a list of decisions, and then choose themes and then do the setting in characters and add some examples for each step:"),
@@ -1235,9 +1234,9 @@ all_idea_lists = [
1235
 
1236
  # List names for reference
1237
  list_names = [
1238
- "GTA Heists", "Battlefront", "Tekken Casino", "Tactics Games", "Chess",
1239
- "Cyberpunk RED", "Community Playthrough", "Random Item Hunt",
1240
- "Survival Mechanics", "Bonus Features", "Multiplayer Features"
1241
  ]
1242
 
1243
  #-------------------------#-------------------------#-------------------------#-------------------------
 
161
  }
162
  """
163
 
 
 
164
  FAQAllprompts = {
165
  "Example Workflow": [
166
+ ("I am writing a story about a chef. Please write dishes to appear on the menu.", " - I am writing a story about a chef. Please write dishes to appear on the menu."),
167
  ("Lets brainstorm some decisions a chef would take", " - What are the most common decisions that a chef story would include?"),
168
  ("Lets brainstorm some problems a chef would face", " - What are the kinds problems that a chef story would include?"),
169
  ("Lets brainstorm some goals the chef would have", " - What are the kinds of out of reach goals that a chef story would include?"),
170
+ ("Please help me add to config that I pasted", " - Continue the pasted config from any complete block."),
171
+ ("Help me think of images for a chef story", ". Help me think of images for a chef story")
172
  ],
173
  "FAQ": [
174
  ("Help me make a story", "- Explain to the user that they need to come up with a list of decisions, and then choose themes and then do the setting in characters and add some examples for each step:"),
 
1234
 
1235
  # List names for reference
1236
  list_names = [
1237
+ "GTA Heists Ideas", "Battlefront Ideas", "Tekken 'Casino' Ideas", "Tactics Games Ideas", "Chess Ideas",
1238
+ "Cyberpunk RED Ideas", "Community Playthrough Ideas", "Random Item Hunt Ideas",
1239
+ "Survival Mechanics Ideas", "Bonus Features Ideas", "Multiplayer Features Ideas"
1240
  ]
1241
 
1242
  #-------------------------#-------------------------#-------------------------#-------------------------