kwabs22 commited on
Commit
ad97da8
·
1 Parent(s): 101ed6c

editing placeholder check

Browse files
Files changed (1) hide show
  1. app.py +51 -6
app.py CHANGED
@@ -159,6 +159,40 @@ def show_elements(text):
159
 
160
  return outputs
161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  def convert_timeline_to_game_structure(timeline):
163
  lines = timeline.split('\n')
164
  game_structure = {}
@@ -463,12 +497,12 @@ initgameinfo = start_game()
463
  #-----------------------------------------------------------------------------------------------------------------------------------
464
 
465
  with gr.Blocks() as demo:
466
- gr.HTML("""Main ideas for this space is (June 2024):
467
  <div style="display: flex; justify-content: center; margin-bottom: 20px; align-items: center;">
468
  <div style="width: 20%; text-align: center">A program exist around data </div>
469
  <div style="width: 20%; text-align: center">We can generate almost any media data and more </div>
470
- <div style="width: 20%; text-align: center">llms good at short questions </div>
471
  <div style="width: 20%; text-align: center">Time moves in a straight so all considerations are flattend by the nature of time </div>
 
472
  <div style="width: 20%; text-align: center">HF + Gradio allows for api use so this my prototype tool for tool use test</div>
473
  </div>""")
474
  with gr.Tab("Skeleton Generator"):
@@ -481,6 +515,11 @@ with gr.Blocks() as demo:
481
  with gr.Row():
482
  game_structure_output_text_with_media = gr.Code(language="json")
483
  game_structure_output_text = gr.Code(language="json")
 
 
 
 
 
484
  with gr.Row():
485
  timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
486
  timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
@@ -496,7 +535,7 @@ with gr.Blocks() as demo:
496
 
497
  @gr.render(inputs=input_text)
498
  def update(text):
499
- return show_elements(text)
500
 
501
  with gr.Tab("Test Example State Machine"):
502
  with gr.Tab("Config Without Assets"):
@@ -635,6 +674,7 @@ with gr.Blocks() as demo:
635
 
636
  with gr.Tab("Save files"):
637
  gr.HTML("For Dynamic events overnight or when player is not active what can LLMS edit? <br><br>eg. Waiting for a letter from a random npc can be decided by the llm <br>eg. Improved Stats on certain days (eg. bitrthday) <br>Privacy <br>User Directed DLC eg. Rockstar Editor with local llm guide")
 
638
  gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/nvidia/Nemotron-4-340B-Instruct (Purpose is supposed to be synthetic data generation) ")
639
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist (9b and under) <br>initial floor for testing can be https://huggingface.co/spaces/Qwen/Qwen2-0.5B-Instruct, https://huggingface.co/spaces/Qwen/Qwen2-1.5b-instruct-demo, https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr, https://huggingface.co/spaces/IndexTeam/Index-1.9B, https://huggingface.co/microsoft/Phi-3-mini-4k-instruct")
640
 
@@ -647,6 +687,7 @@ with gr.Blocks() as demo:
647
  gr.HTML("Images Generation Very Specific position and shape - https://huggingface.co/spaces/linoyts/scribble-sdxl-flash")
648
  gr.HTML("SVG Generation = Coding models - ")
649
  gr.HTML("Vision Models for descriptions <br> https://huggingface.co/spaces/gokaygokay/Florence-2 <br>https://huggingface.co/spaces/vilarin/VL-Chatbox - glm 4v 9b <br>")
 
650
  gr.HTML("Placeholder for huggingface spaces that can assist ")
651
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist")
652
 
@@ -663,7 +704,7 @@ with gr.Blocks() as demo:
663
 
664
  with gr.Tab("3D"):
665
  gr.HTML("Characters, Environments, Objects")
666
- gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/spaces/dylanebert/3d-arena, https://huggingface.co/spaces/stabilityai/TripoSR, https://huggingface.co/spaces/hysts/Shap-E")
667
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist")
668
 
669
  with gr.Tab("Animations (for lower resource use)"):
@@ -696,10 +737,14 @@ with gr.Blocks() as demo:
696
 
697
  gr.HTML("---------------------------------------Gameplay Ideas-------------------------------")
698
  gr.HTML("https://huggingface.co/spaces/Lin-Chen/ShareCaptioner-Video - game use example police questions a event with multiple eye witnesses needs to give as close to the caption description to win")
 
 
 
 
699
  with gr.Tab("Backend and/or Hosting?"):
700
  gr.HTML("Prototyping and freemium <br>free api <br>HF Pro subscription")
701
- gr.HTML("GPU (Data privacy) = No Rate limits? - https://lambdalabs.com/service/gpu-cloud https://huggingface.co/pricing#endpoints https://tensordock.com/cloud-gpus")
702
- gr.HTML("Speed - Groq, SambaNova, ")
703
  gr.HTML("Price - Coding - https://aider.chat/docs/leaderboards/ - https://www.deepseek.com/ 0.3 per million - is this per token or chinese character as that means converting code to chinese if possible can save api cost?")
704
  with gr.Tab("Asset loading test"):
705
  with gr.Row():
 
159
 
160
  return outputs
161
 
162
+ def show_elements_json_input(json_input):
163
+ # Parse the JSON input
164
+ data = json.loads(json_input)
165
+
166
+ outputs = []
167
+
168
+ # Iterate through all locations in the masterlocation1
169
+ for location, details in data['masterlocation1'].items():
170
+ if location == 'end':
171
+ continue
172
+
173
+ description = details['description']
174
+ block_type, content = description.split(': ', 1)
175
+
176
+ if block_type == 'UI':
177
+ # Create HTML for UI elements
178
+ ui_html = f'<div class="ui-element">{content}</div>'
179
+ outputs.append(gr.HTML(ui_html))
180
+ elif block_type == 'Story':
181
+ # Display story elements as Markdown
182
+ outputs.append(gr.Markdown(f"**{content}**"))
183
+ elif block_type == 'Media':
184
+ if content.lower() == 'audio':
185
+ # Placeholder for audio element
186
+ outputs.append(gr.Audio(label=f"Audio: {content}"))
187
+ elif content.lower() == 'video':
188
+ # Placeholder for video element
189
+ outputs.append(gr.Video(label=f"Video: {content}"))
190
+ elif content.lower() == 'image':
191
+ # Placeholder for image element
192
+ outputs.append(gr.Image(label=f"Image: {content}"))
193
+
194
+ return outputs
195
+
196
  def convert_timeline_to_game_structure(timeline):
197
  lines = timeline.split('\n')
198
  game_structure = {}
 
497
  #-----------------------------------------------------------------------------------------------------------------------------------
498
 
499
  with gr.Blocks() as demo:
500
+ gr.HTML("""<div style="width: 20%; text-align: center">Main ideas for this space is (June 2024) (Custom component planning?):</div>
501
  <div style="display: flex; justify-content: center; margin-bottom: 20px; align-items: center;">
502
  <div style="width: 20%; text-align: center">A program exist around data </div>
503
  <div style="width: 20%; text-align: center">We can generate almost any media data and more </div>
 
504
  <div style="width: 20%; text-align: center">Time moves in a straight so all considerations are flattend by the nature of time </div>
505
+ <div style="width: 20%; text-align: center">llms good at short questions </div>
506
  <div style="width: 20%; text-align: center">HF + Gradio allows for api use so this my prototype tool for tool use test</div>
507
  </div>""")
508
  with gr.Tab("Skeleton Generator"):
 
515
  with gr.Row():
516
  game_structure_output_text_with_media = gr.Code(language="json")
517
  game_structure_output_text = gr.Code(language="json")
518
+
519
+ gr.HTML("Editing placeholder")
520
+ @gr.render(inputs=game_structure_output_text_with_media)
521
+ def update(text):
522
+ return show_elements(show_elements_json_input)
523
  with gr.Row():
524
  timeline_output_with_assets = gr.Textbox(label="Timeline with Assets Considered", lines=20)
525
  timeline_output = gr.Textbox(label="Timeline (Order might be different for now)", lines=20)
 
535
 
536
  @gr.render(inputs=input_text)
537
  def update(text):
538
+ return show_elements(text)
539
 
540
  with gr.Tab("Test Example State Machine"):
541
  with gr.Tab("Config Without Assets"):
 
674
 
675
  with gr.Tab("Save files"):
676
  gr.HTML("For Dynamic events overnight or when player is not active what can LLMS edit? <br><br>eg. Waiting for a letter from a random npc can be decided by the llm <br>eg. Improved Stats on certain days (eg. bitrthday) <br>Privacy <br>User Directed DLC eg. Rockstar Editor with local llm guide")
677
+ gr.HTML("Some ideas - In game websites eg. GTA esp stock markets, news; ")
678
  gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/nvidia/Nemotron-4-340B-Instruct (Purpose is supposed to be synthetic data generation) ")
679
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist (9b and under) <br>initial floor for testing can be https://huggingface.co/spaces/Qwen/Qwen2-0.5B-Instruct, https://huggingface.co/spaces/Qwen/Qwen2-1.5b-instruct-demo, https://huggingface.co/spaces/stabilityai/stablelm-2-1_6b-zephyr, https://huggingface.co/spaces/IndexTeam/Index-1.9B, https://huggingface.co/microsoft/Phi-3-mini-4k-instruct")
680
 
 
687
  gr.HTML("Images Generation Very Specific position and shape - https://huggingface.co/spaces/linoyts/scribble-sdxl-flash")
688
  gr.HTML("SVG Generation = Coding models - ")
689
  gr.HTML("Vision Models for descriptions <br> https://huggingface.co/spaces/gokaygokay/Florence-2 <br>https://huggingface.co/spaces/vilarin/VL-Chatbox - glm 4v 9b <br>")
690
+ gr.HTML("Upscalers (save data transfer costs? highly detailed characters?) - https://huggingface.co/spaces/gokaygokay/AuraSR")
691
  gr.HTML("Placeholder for huggingface spaces that can assist ")
692
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist")
693
 
 
704
 
705
  with gr.Tab("3D"):
706
  gr.HTML("Characters, Environments, Objects")
707
+ gr.HTML("Placeholder for huggingface spaces that can assist - https://huggingface.co/spaces/dylanebert/3d-arena, https://huggingface.co/spaces/Wuvin/Unique3D, https://huggingface.co/spaces/stabilityai/TripoSR, https://huggingface.co/spaces/hysts/Shap-E")
708
  gr.HTML("Placeholder for models small enough to run on cpu here in this space that can assist")
709
 
710
  with gr.Tab("Animations (for lower resource use)"):
 
737
 
738
  gr.HTML("---------------------------------------Gameplay Ideas-------------------------------")
739
  gr.HTML("https://huggingface.co/spaces/Lin-Chen/ShareCaptioner-Video - game use example police questions a event with multiple eye witnesses needs to give as close to the caption description to win")
740
+ with gr.Tab("State management through huggingface?"):
741
+ gr.HTML("Huggingface as the login provider? - https://huggingface.co/docs/hub/en/spaces-oauth https://huggingface.co/docs/hub/en/oauth, persistent storage - https://huggingface.co/docs/hub/en/spaces-storage")
742
+ with gr.Tab("Finetuning options"):
743
+ gr.HTML("Price - https://openpipe.ai/pricing")
744
  with gr.Tab("Backend and/or Hosting?"):
745
  gr.HTML("Prototyping and freemium <br>free api <br>HF Pro subscription")
746
+ gr.HTML("GPU (Data privacy) = No Rate limits? - https://replicate.com/pricing, https://lambdalabs.com/service/gpu-cloud https://huggingface.co/pricing#endpoints https://tensordock.com/cloud-gpus")
747
+ gr.HTML("Speed - Groq, SambaNova, https://www.etched.com/announcing-etched ")
748
  gr.HTML("Price - Coding - https://aider.chat/docs/leaderboards/ - https://www.deepseek.com/ 0.3 per million - is this per token or chinese character as that means converting code to chinese if possible can save api cost?")
749
  with gr.Tab("Asset loading test"):
750
  with gr.Row():