SMeyersMrOvkill commited on
Commit
7859444
1 Parent(s): 7e08481
Files changed (1) hide show
  1. app.py +1 -38
app.py CHANGED
@@ -115,40 +115,6 @@ def simple_desc(img, prompt):
115
 
116
  ifc_imgprompt2text = gr.Interface(simple_desc, inputs=[gr.Image(label="input", type="pil"), gr.Textbox(label="prompt")], outputs=[gr.Textbox(label="description"), gr.JSON(label="json")])
117
 
118
-
119
- """
120
- with gr.Blocks() as demo:
121
-
122
- with gr.Row():
123
- with gr.Column():
124
- im1 = gr.Image(label="image 1", type='pil')
125
- otp2 = gr.Textbox(label="image 1", interactive=True)
126
- with gr.Column():
127
- im2 = gr.Image(label="image 2", type='pil')
128
- otp3 = gr.Textbox(label="image 2")
129
- with gr.Row():
130
- minst = gr.Textbox(label="Merge Instructions")
131
- with gr.Row():
132
- btn2 = gr.Button("submit batch")
133
- with gr.Row():
134
- with gr.Column():
135
- im1 = gr.Image(label="image 1", type='pil')
136
- otp2 = gr.Textbox(label="individual batch output (left)", interactive=True)
137
- with gr.Column():
138
- im2 = gr.Image(label="image 2", type='pil')
139
- otp3 = gr.Textbox(label="individual batch output (right)", interactive=True)
140
- with gr.Row():
141
- otp4 = gr.Textbox(label="batch output ( combined )", interactive=True, lines=4)
142
- with gr.Row():
143
- btn_scd = gr.Button("Merge Descriptions to Single Combined Description")
144
- btn2.click(dual_images, inputs=[im1], outputs=[otp2])
145
- btn2.click(dual_images, inputs=[im2], outputs=[otp3])
146
- btn.click(dual_images, inputs=[img], outputs=[otpt])
147
- btn_scd.click(merge_descriptions_to_prompt, inputs=[minst, otp2, otp3], outputs=[otp4])
148
-
149
- demo.launch(debug=True, share=True)
150
- """
151
-
152
  def chat(inpt, mess):
153
  from together import Together
154
  print(inpt, mess)
@@ -189,8 +155,5 @@ chatbot = gr.Chatbot(
189
  pathlib.Path("image2.jpeg")
190
  ])
191
 
192
- jsn = None
193
- chat_input = None
194
- with gr.TabbedInterface([ifc_imgprompt2text, gr.ChatInterface(chat, chatbot=chatbot, submit_btn=gr.Button(scale=1)), gr.Interface(lambda _: "", inputs=[jsn := gr.JSON(label="conversation")], outputs=[jsn])], ["Prompt & Image 2 Text", "Chat w/ Llama 3 70b & Moondream 2", "data_ignoreme"]) as ifc:
195
- jsn = gr.JSON(label="conversation", visible=True)
196
  ifc.launch(share=False, debug=True)
 
115
 
116
  ifc_imgprompt2text = gr.Interface(simple_desc, inputs=[gr.Image(label="input", type="pil"), gr.Textbox(label="prompt")], outputs=[gr.Textbox(label="description"), gr.JSON(label="json")])
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  def chat(inpt, mess):
119
  from together import Together
120
  print(inpt, mess)
 
155
  pathlib.Path("image2.jpeg")
156
  ])
157
 
158
+ with gr.TabbedInterface([ifc_imgprompt2text, gr.ChatInterface(chat, chatbot=chatbot, submit_btn=gr.Button(scale=1))], ["Prompt & Image 2 Text", "Chat w/ Llama 3 70b & Moondream 2"]) as ifc:
 
 
 
159
  ifc.launch(share=False, debug=True)