Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,11 @@ def process_document(image,sendimg):
|
|
47 |
bio.seek(0)
|
48 |
media = {"type": "photo", "media": "attach://photo", "caption": "New doc is being tried out:"}
|
49 |
data = {"media": json.dumps(media)}
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
52 |
# prepare encoder inputs
|
53 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|
54 |
|
|
|
47 |
bio.seek(0)
|
48 |
media = {"type": "photo", "media": "attach://photo", "caption": "New doc is being tried out:"}
|
49 |
data = {"media": json.dumps(media)}
|
50 |
+
try:
|
51 |
+
response = requests.post(url, files={'photo': bio}, data=data)
|
52 |
+
except error:
|
53 |
+
|
54 |
+
|
55 |
# prepare encoder inputs
|
56 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|
57 |
|