to-be commited on
Commit
4fa7e16
1 Parent(s): 6b45627

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- response = requests.post(url, files={'photo': bio}, caption='New doc tried out!')
 
 
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