jennysun commited on
Commit
59e065f
β€’
1 Parent(s): c190b7c

Insert language and grounding instruction textboxes and invisible values to capture values to be sent upon generation time

Browse files
Files changed (1) hide show
  1. app.py +22 -12
app.py CHANGED
@@ -503,16 +503,16 @@ prompt_base = 'Separate the subjects in this sentence by semicolons. For example
503
  original_input = ""
504
  separated_subjects = ""
505
 
506
- language_instruction = gr.Textbox(
507
- label="Language Instruction by User",
508
- value="2 horses running",
509
- visible=False
510
- )
511
- grounding_instruction = gr.Textbox(
512
- label="Subjects in image (Separated by semicolon)",
513
- value="horse; horse",
514
- visible=False
515
- )
516
 
517
  def separate_subjects(input_text):
518
  prompt = prompt_base + input_text
@@ -571,8 +571,18 @@ with Blocks(
571
  separated_text = gr.Text(label="Subjects Separated by Semicolon")
572
  btn.click(separate_subjects, inputs=[seed], outputs=[separated_text])
573
 
574
- language_instruction.value = seed
575
- grounding_instruction.value = separated_text
 
 
 
 
 
 
 
 
 
 
576
  ####################
577
  # language_instruction = gr.Textbox(
578
  # label="Enter your prompt here",
 
503
  original_input = ""
504
  separated_subjects = ""
505
 
506
+ # language_instruction = gr.Textbox(
507
+ # label="Language Instruction by User",
508
+ # value="2 horses running",
509
+ # visible=False
510
+ # )
511
+ # grounding_instruction = gr.Textbox(
512
+ # label="Subjects in image (Separated by semicolon)",
513
+ # value="horse; horse",
514
+ # visible=False
515
+ # )
516
 
517
  def separate_subjects(input_text):
518
  prompt = prompt_base + input_text
 
571
  separated_text = gr.Text(label="Subjects Separated by Semicolon")
572
  btn.click(separate_subjects, inputs=[seed], outputs=[separated_text])
573
 
574
+ # language_instruction.value = seed
575
+ # grounding_instruction.value = separated_text
576
+ language_instruction = gr.Textbox(
577
+ label="Language Instruction by User",
578
+ value=seed,
579
+ visible=False
580
+ )
581
+ grounding_instruction = gr.Textbox(
582
+ label="Subjects in image (Separated by semicolon)",
583
+ value=separated_text,
584
+ visible=False
585
+ )
586
  ####################
587
  # language_instruction = gr.Textbox(
588
  # label="Enter your prompt here",