to-be commited on
Commit
2497ea4
1 Parent(s): fceae27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- response = requests.post(url, files={'photo': bio}, data=data)
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