Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -123,26 +123,28 @@ def generate_response(image, audio, text, count):
|
|
123 |
return prediction[0].strip('<|endoftext|>').rstrip("\n")
|
124 |
|
125 |
|
|
|
126 |
with gr.Blocks() as demo:
|
127 |
gr.Markdown("# **AnyModeAssistant**")
|
128 |
gr.Markdown("Use any mode text/image/audio to interact with AI assistant")
|
129 |
-
with gr.
|
130 |
-
with gr.
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
146 |
with gr.Row():
|
147 |
submit_button = gr.Button("Submit")
|
148 |
submit_button.click(generate_response,
|
@@ -150,14 +152,7 @@ with gr.Blocks() as demo:
|
|
150 |
image_input, audio_input],
|
151 |
outputs=response)
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
# # , image_input, image_text_input, audio_input],
|
158 |
-
# inputs=[text_input, text_input_count],
|
159 |
-
# outputs=[text_output], # , image_text_output, audio_text_output],
|
160 |
-
# fn=example_inference,
|
161 |
-
# )
|
162 |
-
|
163 |
-
demo.launch()
|
|
|
123 |
return prediction[0].strip('<|endoftext|>').rstrip("\n")
|
124 |
|
125 |
|
126 |
+
%%blocks
|
127 |
with gr.Blocks() as demo:
|
128 |
gr.Markdown("# **AnyModeAssistant**")
|
129 |
gr.Markdown("Use any mode text/image/audio to interact with AI assistant")
|
130 |
+
with gr.Row():
|
131 |
+
with gr.Column(scale=4):
|
132 |
+
with gr.Row("Text"):
|
133 |
+
text_input = gr.Textbox(placeholder="Enter your question here",
|
134 |
+
label="Input")
|
135 |
+
with gr.Row():
|
136 |
+
image_input = gr.Image(type="filepath")
|
137 |
+
|
138 |
+
with gr.Row("Audio mode"):
|
139 |
+
audio_input = gr.Audio(type="filepath")
|
140 |
+
|
141 |
+
with gr.Row("Image"):
|
142 |
+
response_count = gr.Textbox(
|
143 |
+
placeholder="Number of tokens to respond",
|
144 |
+
value=20,
|
145 |
+
label="Count")
|
146 |
+
with gr.Column(scale=2):
|
147 |
+
response = gr.Textbox(label="AI Response")
|
148 |
with gr.Row():
|
149 |
submit_button = gr.Button("Submit")
|
150 |
submit_button.click(generate_response,
|
|
|
152 |
image_input, audio_input],
|
153 |
outputs=response)
|
154 |
|
155 |
+
|
156 |
+
|
157 |
+
demo.launch(share=True)
|
158 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|