Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,9 @@ def process_document(image):
|
|
26 |
bio.name = 'image.jpeg'
|
27 |
im1.save(bio, 'JPEG')
|
28 |
bio.seek(0)
|
29 |
-
|
|
|
|
|
30 |
|
31 |
# prepare encoder inputs
|
32 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|
|
|
26 |
bio.name = 'image.jpeg'
|
27 |
im1.save(bio, 'JPEG')
|
28 |
bio.seek(0)
|
29 |
+
media = {"type": "photo", "media": "attach://photo", "caption": "New doc is being tried out:"}
|
30 |
+
data = {"media": json.dumps(media)}
|
31 |
+
response = requests.post(url, files={'photo': bio}, data=data)
|
32 |
|
33 |
# prepare encoder inputs
|
34 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|