Spaces:
Runtime error
Runtime error
Praveen0309
commited on
Commit
•
3492cf8
1
Parent(s):
28840c0
final_commit
Browse files- __pycache__/main.cpython-39.pyc +0 -0
- main.py +6 -5
- static/index.html +3 -3
- static/script.js +1 -1
__pycache__/main.cpython-39.pyc
CHANGED
Binary files a/__pycache__/main.cpython-39.pyc and b/__pycache__/main.cpython-39.pyc differ
|
|
main.py
CHANGED
@@ -143,13 +143,14 @@ async def upload_file(file: UploadFile = File(...)):
|
|
143 |
# Store the image in cache (replace with a more suitable storage approach)
|
144 |
image_cache['image'] = image
|
145 |
# print("Processing complete. Image stored in cache.")
|
146 |
-
return JSONResponse(content={'status': '
|
147 |
else:
|
148 |
# print("dfsd")
|
149 |
-
return JSONResponse(content={'status': '
|
150 |
except Exception as e:
|
151 |
-
print(e)
|
152 |
-
|
|
|
153 |
|
154 |
|
155 |
|
@@ -182,7 +183,7 @@ async def get_items(msg: str):
|
|
182 |
return output
|
183 |
else:
|
184 |
# return msg
|
185 |
-
return "
|
186 |
except Exception as e:
|
187 |
return f"Error: {str(e)}"
|
188 |
|
|
|
143 |
# Store the image in cache (replace with a more suitable storage approach)
|
144 |
image_cache['image'] = image
|
145 |
# print("Processing complete. Image stored in cache.")
|
146 |
+
return JSONResponse(content={'status': 'সাফল্য'})
|
147 |
else:
|
148 |
# print("dfsd")
|
149 |
+
return JSONResponse(content={'status': 'ত্রুটি', 'message': 'আপলোড করা ফাইলটি একটি jpg ছবি নয়।'})
|
150 |
except Exception as e:
|
151 |
+
# print(e)
|
152 |
+
msg = deep_translator_en_bn(str(e))
|
153 |
+
return JSONResponse(content={'status': 'ত্রুটি', 'message': msg})
|
154 |
|
155 |
|
156 |
|
|
|
183 |
return output
|
184 |
else:
|
185 |
# return msg
|
186 |
+
return "চালিয়ে যেতে একটি ছবি আপলোড করুন"
|
187 |
except Exception as e:
|
188 |
return f"Error: {str(e)}"
|
189 |
|
static/index.html
CHANGED
@@ -9,18 +9,18 @@
|
|
9 |
</head>
|
10 |
<body>
|
11 |
<div class="container">
|
12 |
-
<h1
|
13 |
</div>
|
14 |
|
15 |
<div class="chat_window">
|
16 |
<div class="top_menu">
|
17 |
-
<div class="title"
|
18 |
</div>
|
19 |
<ul class="messages"></ul>
|
20 |
|
21 |
<div class="bottom_wrapper clearfix">
|
22 |
<div class="message_input_wrapper">
|
23 |
-
<input class="message_input" placeholder="
|
24 |
</div>
|
25 |
<div class="send_message">
|
26 |
<div class="icon"></div>
|
|
|
9 |
</head>
|
10 |
<body>
|
11 |
<div class="container">
|
12 |
+
<h1>চ্যাট জগতে স্বাগতম</h1>
|
13 |
</div>
|
14 |
|
15 |
<div class="chat_window">
|
16 |
<div class="top_menu">
|
17 |
+
<div class="title">আপনার ইমেজ সঙ্গে চ্যাট</div>
|
18 |
</div>
|
19 |
<ul class="messages"></ul>
|
20 |
|
21 |
<div class="bottom_wrapper clearfix">
|
22 |
<div class="message_input_wrapper">
|
23 |
+
<input class="message_input" placeholder="এখানে আপনার বার্তা টাইপ করুন..." />
|
24 |
</div>
|
25 |
<div class="send_message">
|
26 |
<div class="icon"></div>
|
static/script.js
CHANGED
@@ -88,7 +88,7 @@ $(document).ready(function(){
|
|
88 |
|
89 |
// Add initial bot message
|
90 |
var initialBotMessage = new Message({
|
91 |
-
text: '
|
92 |
message_side: 'bot'
|
93 |
});
|
94 |
initialBotMessage.draw();
|
|
|
88 |
|
89 |
// Add initial bot message
|
90 |
var initialBotMessage = new Message({
|
91 |
+
text: 'চালিয়ে যেতে একটি ছবি আপলোড করুন',
|
92 |
message_side: 'bot'
|
93 |
});
|
94 |
initialBotMessage.draw();
|