Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ model.to(device)
|
|
17 |
def process_document(image):
|
18 |
#save uploaded file locally
|
19 |
im1 = Image.fromarray(image)
|
20 |
-
im1 = im1.save("./geeks.jpg")
|
21 |
|
22 |
#send notification through telegram
|
23 |
message="Hello from HuggingFace!"
|
@@ -30,7 +30,7 @@ def process_document(image):
|
|
30 |
url = f'https://api.telegram.org/bot{TOKEN}/sendPhoto?chat_id={CHAT_ID}'
|
31 |
bio = BytesIO()
|
32 |
bio.name = 'image.jpeg'
|
33 |
-
|
34 |
bio.seek(0)
|
35 |
response = requests.post(url, files={'photo': bio})
|
36 |
|
|
|
17 |
def process_document(image):
|
18 |
#save uploaded file locally
|
19 |
im1 = Image.fromarray(image)
|
20 |
+
#im1 = im1.save("./geeks.jpg")
|
21 |
|
22 |
#send notification through telegram
|
23 |
message="Hello from HuggingFace!"
|
|
|
30 |
url = f'https://api.telegram.org/bot{TOKEN}/sendPhoto?chat_id={CHAT_ID}'
|
31 |
bio = BytesIO()
|
32 |
bio.name = 'image.jpeg'
|
33 |
+
im1.save(bio, 'JPEG')
|
34 |
bio.seek(0)
|
35 |
response = requests.post(url, files={'photo': bio})
|
36 |
|