kwabs22 commited on
Commit
d6db96f
·
1 Parent(s): 21ccdf9

Merge game and edit interfaces

Browse files
Files changed (1) hide show
  1. app.py +18 -21
app.py CHANGED
@@ -713,19 +713,17 @@ with gr.Blocks() as demo:
713
  def update(text):
714
  return show_elements(text)
715
  with gr.Accordion("Proto Config Assist"):
716
- gr.Markdown("Editing placeholder")
717
  with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
718
  gr.Markdown("# Story and Timeline Generator")
719
  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")
720
- with gr.Accordion("JSON with no edits"):
721
- with gr.Row():
722
- timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
723
- timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
724
- story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
725
- with gr.Row():
726
  game_structure_output_text_with_media = gr.Code(language="json")
727
  game_structure_output_text = gr.Code(language="json")
728
-
 
 
 
 
729
  with gr.Row():
730
  generate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
731
  generate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
@@ -876,18 +874,17 @@ with gr.Blocks() as demo:
876
  # def update(text):
877
  # return show_elements(text)
878
  with gr.Accordion("Proto Config Assist"):
879
- gr.Markdown("Editing placeholder")
880
  with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
881
  gr.Markdown("# Story and Timeline Generator")
882
  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")
883
- with gr.Accordion("JSON with no edits"):
884
- with gr.Row():
885
- ewptimeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
886
- ewptimeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
887
- ewpstory_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
888
- with gr.Row():
889
- ewpgame_structure_output_text_with_media = gr.Code(language="json")
890
- ewpgame_structure_output_text = gr.Code(language="json")
891
 
892
  with gr.Row():
893
  ewpgenerate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
@@ -895,11 +892,11 @@ with gr.Blocks() as demo:
895
  ewpgenerate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
896
  ewpgenerate_button = gr.Button("Generate Story and Timeline")
897
 
898
- @gr.render(inputs=ewpgame_structure_output_text_with_media)
899
- def update(ewpgame_structure_output_text_with_media):
900
- return show_elements_json_input(ewpgame_structure_output_text_with_media)
901
 
902
- ewpgenerate_button.click(generate_story_and_timeline, inputs=[ewpgenerate_no_ui_timeline_points, ewpgenerate_no_media_timeline_points, ewpgenerate_with_media_check], outputs=[ewptimeline_output_with_assets, ewptimeline_output, ewpstory_output, ewpgame_structure_output_text_with_media, ewpgame_structure_output_text])
903
 
904
  with gr.Tab("Custom JS Config Creator"):
905
  gr.HTML("-- Incomplete -- Companion Space for zerogpu / client api workflow planning for a way to send a zip to the Basic Game Engine at the bottom of https://huggingface.co/spaces/KwabsHug/TestSvelteStatic (Also to test how much can be done majority on cpu)")
 
713
  def update(text):
714
  return show_elements(text)
715
  with gr.Accordion("Proto Config Assist"):
 
716
  with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
717
  gr.Markdown("# Story and Timeline Generator")
718
  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")
719
+ with gr.Row():
 
 
 
 
 
720
  game_structure_output_text_with_media = gr.Code(language="json")
721
  game_structure_output_text = gr.Code(language="json")
722
+ with gr.Accordion("JSON with no edits"):
723
+ with gr.Row():
724
+ timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
725
+ timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
726
+ story_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
727
  with gr.Row():
728
  generate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
729
  generate_no_media_timeline_points = gr.Slider(minimum=1, value=5, step=1, maximum=30, label="Choose the amount of media timeline points")
 
874
  # def update(text):
875
  # return show_elements(text)
876
  with gr.Accordion("Proto Config Assist"):
 
877
  with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
878
  gr.Markdown("# Story and Timeline Generator")
879
  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")
880
+ with gr.Row():
881
+ ewpgame_structure_output_text_with_media = gr.Code(language="json")
882
+ ewpgame_structure_output_text = gr.Code(language="json")
883
+ with gr.Accordion("JSON with no edits"):
884
+ with gr.Row():
885
+ ewptimeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
886
+ ewptimeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
887
+ ewpstory_output = gr.Textbox(label="Generated Story (Order might be different for now)", lines=20)
888
 
889
  with gr.Row():
890
  ewpgenerate_no_ui_timeline_points = gr.Slider(minimum=1, value=10, step=1, maximum=30, label="Choose the amount of ui timeline points")
 
892
  ewpgenerate_with_media_check = gr.Checkbox(label="Generate with media", value=True)
893
  ewpgenerate_button = gr.Button("Generate Story and Timeline")
894
 
895
+ @gr.render(inputs=ewpwacustom_config) #ewpgame_structure_output_text_with_media
896
+ def update(ewpwacustom_config):
897
+ return show_elements_json_input(ewpwacustom_config)
898
 
899
+ ewpgenerate_button.click(generate_story_and_timeline, inputs=[ewpgenerate_no_ui_timeline_points, ewpgenerate_no_media_timeline_points, ewpgenerate_with_media_check], outputs=[ewptimeline_output_with_assets, ewptimeline_output, ewpstory_output, ewpwacustom_config, ewpgame_structure_output_text]) #ewpgame_structure_output_text_with_media, ewpgame_structure_output_text])
900
 
901
  with gr.Tab("Custom JS Config Creator"):
902
  gr.HTML("-- Incomplete -- Companion Space for zerogpu / client api workflow planning for a way to send a zip to the Basic Game Engine at the bottom of https://huggingface.co/spaces/KwabsHug/TestSvelteStatic (Also to test how much can be done majority on cpu)")