sohojoe commited on
Commit
24c5aef
1 Parent(s): 6af055a

start of API

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py CHANGED
@@ -548,6 +548,36 @@ My interest is to use CLIP for image/video understanding (see [CLIP_visual-spati
548
 
549
  """)
550
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
  # ![Alt Text](file/pup1.jpg)
552
 
553
  # <img src="file/pup1.jpg" width="100" height="100">
 
548
 
549
  """)
550
 
551
+ # # Options
552
+ # gr.Markdown(
553
+ # """
554
+ # ### Options
555
+ # """)
556
+ # with gr.Row():
557
+ # combined_embedding_mode = gr.Radio(choices=["Sum", "Average"], label="How to combine embedding", show_label=True, value="Sum", interactive=True)
558
+
559
+ # API
560
+ with gr.Row():
561
+ gr.Markdown(
562
+ """
563
+ ### API
564
+
565
+ UI elements to mock out the API
566
+ """)
567
+ with gr.Row():
568
+ _input = gr.Textbox(label="Input")
569
+ with gr.Accordion(f"Embeddings (base64)", open=False):
570
+ _output = gr.Textbox(value="", lines=2, label="Output")
571
+ _btn = gr.Button(value="Submit")
572
+ _btn.click(on_prompt_change_update_embeddings, inputs=_input, outputs=[_output], api_name="text_to_embeddings")
573
+ # input_prompts[i] = gr.Textbox(label="Text Prompt", show_label=True, max_lines=4, api_name="text_to_embeddings")
574
+ with gr.Row():
575
+ _input = gr.Image(label="Image Prompt", show_label=True)
576
+ with gr.Accordion(f"Embeddings (base64)", open=False):
577
+ _output = gr.Textbox(value="", lines=2, label="Output")
578
+ _btn = gr.Button(value="Submit")
579
+ _btn.click(on_image_load_update_embeddings, inputs=_input, outputs=[_output], api_name="image_to_embeddings")
580
+
581
  # ![Alt Text](file/pup1.jpg)
582
 
583
  # <img src="file/pup1.jpg" width="100" height="100">