Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
|
|
3 |
|
4 |
examples = [
|
5 |
{"text": "What is this image?", "files": ["sample/ducky.jpg"]},
|
@@ -20,8 +21,9 @@ def add_message(history, message):
|
|
20 |
|
21 |
# Function to generate the bot's response
|
22 |
def bot(history, user_input):
|
|
|
23 |
if history:
|
24 |
-
history[-1][1] =
|
25 |
return history
|
26 |
|
27 |
def main():
|
@@ -57,4 +59,6 @@ def main():
|
|
57 |
webApp.launch(share=True)
|
58 |
|
59 |
if __name__ == "__main__":
|
|
|
|
|
60 |
main()
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
+
import multimodal_ai.py as ai
|
4 |
|
5 |
examples = [
|
6 |
{"text": "What is this image?", "files": ["sample/ducky.jpg"]},
|
|
|
21 |
|
22 |
# Function to generate the bot's response
|
23 |
def bot(history, user_input):
|
24 |
+
response = ai_assistant.generate_response(user_input)
|
25 |
if history:
|
26 |
+
history[-1][1] = response
|
27 |
return history
|
28 |
|
29 |
def main():
|
|
|
59 |
webApp.launch(share=True)
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
+
# Initialize llm
|
63 |
+
ai_assistant = ai()
|
64 |
main()
|