kwabs22 commited on
Commit
40f8ce2
·
1 Parent(s): ad97da8

editing placeholder check

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -120,7 +120,7 @@ def generate_story_and_timeline(include_media=True):
120
 
121
  game_structure_with_media, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
122
 
123
- return formatted_timeline, no_media_formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), json.dumps(game_structure_without_media, indent=2) #, game_structure_with_media
124
 
125
  media_file_types = ["image", "video", "audio"]
126
 
@@ -515,9 +515,10 @@ with gr.Blocks() as demo:
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():
@@ -527,7 +528,7 @@ with gr.Blocks() as demo:
527
  #gr.Textbox("Do all fit on same row")
528
 
529
  generate_button = gr.Button("Generate Story and Timeline")
530
- 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])
531
 
532
  gr.HTML("Splits by new line")
533
  input_text = gr.Textbox(label="Input Text", lines=10)
 
120
 
121
  game_structure_with_media, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
122
 
123
+ return formatted_timeline, no_media_formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), json.dumps(game_structure_without_media, indent=2), game_structure_with_media #, game_structure_with_media
124
 
125
  media_file_types = ["image", "video", "audio"]
126
 
 
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
+ json_input_game_structure_output_text_with_media = gr.State()
519
 
520
  gr.HTML("Editing placeholder")
521
+ @gr.render(inputs=json_input_game_structure_output_text_with_media)
522
  def update(text):
523
  return show_elements(show_elements_json_input)
524
  with gr.Row():
 
528
  #gr.Textbox("Do all fit on same row")
529
 
530
  generate_button = gr.Button("Generate Story and Timeline")
531
+ 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, json_input_game_structure_output_text_with_media])
532
 
533
  gr.HTML("Splits by new line")
534
  input_text = gr.Textbox(label="Input Text", lines=10)