kwabs22 commited on
Commit
29857f3
·
1 Parent(s): 879ad5c

Reorder UI

Browse files
Files changed (1) hide show
  1. app.py +65 -65
app.py CHANGED
@@ -514,9 +514,72 @@ initgameinfo = start_game()
514
  #-----------------------------------------------------------------------------------------------------------------------------------
515
 
516
  with gr.Blocks() as demo:
517
- gr.HTML("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)")
518
  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")
519
- with gr.Tab("Config Creator"):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  with gr.Tab("Simple Config Creator"):
521
  inventory_items = gr.State([])
522
  skills_items = gr.State([])
@@ -588,69 +651,6 @@ with gr.Blocks() as demo:
588
 
589
  with gr.Tab("Advanced Config Creator"):
590
  gr.HTML("Config with More than text and images")
591
- with gr.Tab("Skeleton Generator"):
592
- gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
593
- 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")
594
- with gr.Tab("Generate Timeline"):
595
- with gr.Tab("Without Asset generation consideration"):
596
- gr.Markdown("# Story and Timeline Generator")
597
- gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events.")
598
-
599
- with gr.Row():
600
- timeline_output = gr.Textbox(label="Timeline", lines=20)
601
- story_output = gr.Textbox(label="Generated Story", lines=20)
602
-
603
- generate_button = gr.Button("Generate Story and Timeline")
604
- generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output, story_output])
605
- with gr.Tab("Asset generation considered"):
606
- gr.HTML("placeholder")
607
-
608
- with gr.Tab("Prototype for finegrained editing of time line before conversion to game format"):
609
- gr.Textbox(value=timeline_with_media)
610
- gr.Textbox(value=timeline_without_media)
611
- gr.HTML("Splits by new line")
612
- input_text = gr.Textbox(label="Input Text", lines=10)
613
- output_group = gr.Group()
614
-
615
- @gr.render(inputs=input_text)
616
- def update(text):
617
- return show_elements(text)
618
- with gr.Tab("Conversion of game version"):
619
- media_checkbox = gr.Checkbox(label="Include Media")
620
- output_text = gr.Code(language="json")
621
-
622
- media_checkbox.change(
623
- fn=show_game_structure,
624
- inputs=[media_checkbox],
625
- outputs=[output_text]
626
- )
627
- with gr.Tab("Test Example State Machine"):
628
- with gr.Row():
629
- with gr.Column(scale=2):
630
- gr.Markdown("# Text-based Adventure Game")
631
-
632
- description = gr.Textbox(label="Current Situation", lines=4, value=initgameinfo[0])
633
- choices = gr.Radio(label="Your Choices", choices=initgameinfo[1])
634
- submit_btn = gr.Button("Make Choice")
635
- game_log = gr.Textbox(label="Game Log", lines=20, value=initgameinfo[2])
636
- game_session = gr.State(value=initgameinfo[3])
637
- submit_btn.click(
638
- make_choice,
639
- inputs=[choices, game_session],
640
- outputs=[description, choices, game_log, game_session]
641
- )
642
- with gr.Column(scale=1):
643
- gr.Markdown("# Debugging")
644
- error_box = gr.Textbox(label="Path Errors", lines=4, value=path_errors)
645
- with gr.Accordion("Config (Game Spoiler)", open=False):
646
- custom_config = gr.Textbox(label="Custom Configuration (JSON)", value=json.dumps(all_states, default=lambda o: o.__dict__, indent=2), lines=8)
647
- custom_configbtn = gr.Button("Load Custom Config")
648
-
649
- custom_configbtn.click(
650
- load_game,
651
- inputs=[custom_config],
652
- outputs=[error_box, game_log, description, choices, game_session, custom_config]
653
- )
654
 
655
 
656
  with gr.Tab("Asset Generation"):
 
514
  #-----------------------------------------------------------------------------------------------------------------------------------
515
 
516
  with gr.Blocks() as demo:
 
517
  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")
518
+ with gr.Tab("Skeleton Generator"):
519
+ gr.HTML("Some Kinds of game skeletons ideas - Timelines, Graph as State machine paths, Economy ecosystem")
520
+ 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")
521
+ with gr.Tab("Generate Timeline"):
522
+ with gr.Tab("Without Asset generation consideration"):
523
+ gr.Markdown("# Story and Timeline Generator")
524
+ gr.Markdown("Click the button to generate a random timeline and story based on UI elements and story events.")
525
+
526
+ with gr.Row():
527
+ timeline_output = gr.Textbox(label="Timeline", lines=20)
528
+ story_output = gr.Textbox(label="Generated Story", lines=20)
529
+
530
+ generate_button = gr.Button("Generate Story and Timeline")
531
+ generate_button.click(generate_story_and_timeline, inputs=[], outputs=[timeline_output, story_output])
532
+ with gr.Tab("Asset generation considered"):
533
+ gr.HTML("placeholder")
534
+
535
+ with gr.Tab("Prototype for finegrained editing of time line before conversion to game format"):
536
+ gr.Textbox(value=timeline_with_media)
537
+ gr.Textbox(value=timeline_without_media)
538
+ gr.HTML("Splits by new line")
539
+ input_text = gr.Textbox(label="Input Text", lines=10)
540
+ output_group = gr.Group()
541
+
542
+ @gr.render(inputs=input_text)
543
+ def update(text):
544
+ return show_elements(text)
545
+ with gr.Tab("Conversion of game version"):
546
+ media_checkbox = gr.Checkbox(label="Include Media")
547
+ output_text = gr.Code(language="json")
548
+
549
+ media_checkbox.change(
550
+ fn=show_game_structure,
551
+ inputs=[media_checkbox],
552
+ outputs=[output_text]
553
+ )
554
+ with gr.Tab("Test Example State Machine"):
555
+ with gr.Row():
556
+ with gr.Column(scale=2):
557
+ gr.Markdown("# Text-based Adventure Game")
558
+
559
+ description = gr.Textbox(label="Current Situation", lines=4, value=initgameinfo[0])
560
+ choices = gr.Radio(label="Your Choices", choices=initgameinfo[1])
561
+ submit_btn = gr.Button("Make Choice")
562
+ game_log = gr.Textbox(label="Game Log", lines=20, value=initgameinfo[2])
563
+ game_session = gr.State(value=initgameinfo[3])
564
+ submit_btn.click(
565
+ make_choice,
566
+ inputs=[choices, game_session],
567
+ outputs=[description, choices, game_log, game_session]
568
+ )
569
+ with gr.Column(scale=1):
570
+ gr.Markdown("# Debugging")
571
+ error_box = gr.Textbox(label="Path Errors", lines=4, value=path_errors)
572
+ with gr.Accordion("Config (Game Spoiler)", open=False):
573
+ custom_config = gr.Textbox(label="Custom Configuration (JSON)", value=json.dumps(all_states, default=lambda o: o.__dict__, indent=2), lines=8)
574
+ custom_configbtn = gr.Button("Load Custom Config")
575
+
576
+ custom_configbtn.click(
577
+ load_game,
578
+ inputs=[custom_config],
579
+ outputs=[error_box, game_log, description, choices, game_session, custom_config]
580
+ )
581
+ with gr.Tab("Custom JS Config Creator"):
582
+ gr.HTML("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)")
583
  with gr.Tab("Simple Config Creator"):
584
  inventory_items = gr.State([])
585
  skills_items = gr.State([])
 
651
 
652
  with gr.Tab("Advanced Config Creator"):
653
  gr.HTML("Config with More than text and images")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
654
 
655
 
656
  with gr.Tab("Asset Generation"):