Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,22 +95,25 @@ def query_model(question):
|
|
95 |
return "Could not find specific information. Please refine your question."
|
96 |
response = generate_response(question, relevant_segment)
|
97 |
return response
|
|
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
114 |
|
115 |
# Define the welcome message and specific topics the chatbot can provide information about
|
116 |
welcome_message = """
|
|
|
95 |
return "Could not find specific information. Please refine your question."
|
96 |
response = generate_response(question, relevant_segment)
|
97 |
return response
|
98 |
+
|
99 |
|
100 |
+
# Path to the image
|
101 |
+
image_path = "composting.jpg"
|
102 |
+
resized_image_path = "composting_resized.jpg"
|
103 |
+
|
104 |
+
# Check if the image file exists
|
105 |
+
if os.path.exists(image_path):
|
106 |
+
# Open and resize the image
|
107 |
+
with Image.open(image_path) as img:
|
108 |
+
# Define the new size (e.g., reducing size by 50%)
|
109 |
+
new_size = (int(img.size[0] * 0.5), int(img.size[1] * 0.5))
|
110 |
+
# Resize the image
|
111 |
+
resized_img = img.resize(new_size, Image.ANTIALIAS)
|
112 |
+
# Save the resized image
|
113 |
+
resized_img.save(resized_image_path)
|
114 |
+
else:
|
115 |
+
print(f"Error: The image file '{image_path}' was not found.")
|
116 |
+
exit(1)
|
117 |
|
118 |
# Define the welcome message and specific topics the chatbot can provide information about
|
119 |
welcome_message = """
|