Spaces:
Sleeping
Sleeping
cha0smagick
commited on
Commit
•
5942d3d
1
Parent(s):
6bc1c36
Update app.py
Browse files
app.py
CHANGED
@@ -15,12 +15,12 @@ def clean_text(text):
|
|
15 |
return cleaned_text
|
16 |
|
17 |
|
18 |
-
def generate_response(
|
19 |
global error_flag # Use the global error_flag variable
|
20 |
|
21 |
try:
|
22 |
# Generate response using the model
|
23 |
-
response = model.generate_content(
|
24 |
|
25 |
# Display the generated response
|
26 |
full_response = ""
|
@@ -107,7 +107,7 @@ def main():
|
|
107 |
)
|
108 |
|
109 |
# Generate the response
|
110 |
-
full_response = generate_response(bot_command, model, img)
|
111 |
|
112 |
# Display the generated response
|
113 |
st.success(full_response)
|
|
|
15 |
return cleaned_text
|
16 |
|
17 |
|
18 |
+
def generate_response(contents, model, image_file):
|
19 |
global error_flag # Use the global error_flag variable
|
20 |
|
21 |
try:
|
22 |
# Generate response using the model
|
23 |
+
response = model.generate_content(contents, image=image_file, stream=True)
|
24 |
|
25 |
# Display the generated response
|
26 |
full_response = ""
|
|
|
107 |
)
|
108 |
|
109 |
# Generate the response
|
110 |
+
full_response = generate_response([bot_command, cleaned_input], model, [img, user_input])
|
111 |
|
112 |
# Display the generated response
|
113 |
st.success(full_response)
|