Spaces:
Runtime error
Runtime error
Praveen0309
commited on
Commit
•
67ecb5a
1
Parent(s):
1c1dfab
Done
Browse files
app.py
CHANGED
@@ -120,7 +120,7 @@ image_cache = {}
|
|
120 |
def upload_file():
|
121 |
try:
|
122 |
file = request.files['file']
|
123 |
-
if file.filename.endswith('.jpg'):
|
124 |
image = Image.open(file.stream)
|
125 |
# Store the image in cache (replace with a more suitable storage approach)
|
126 |
image_cache['image'] = image
|
@@ -135,7 +135,7 @@ def upload_file():
|
|
135 |
|
136 |
|
137 |
|
138 |
-
@app.route("/get
|
139 |
def get_bot_response():
|
140 |
try:
|
141 |
if 'image' in image_cache:
|
|
|
120 |
def upload_file():
|
121 |
try:
|
122 |
file = request.files['file']
|
123 |
+
if file.filename.endswith(('.png', '.jpg', '.jpeg')):
|
124 |
image = Image.open(file.stream)
|
125 |
# Store the image in cache (replace with a more suitable storage approach)
|
126 |
image_cache['image'] = image
|
|
|
135 |
|
136 |
|
137 |
|
138 |
+
@app.route("/get")
|
139 |
def get_bot_response():
|
140 |
try:
|
141 |
if 'image' in image_cache:
|