mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 07:04:59 +01:00
change to use image files in memory
This commit is contained in:
@@ -381,6 +381,5 @@ def cleanup_intermediate_files(response: any):
|
||||
|
||||
|
||||
# Function to encode the image
|
||||
def encode_image(image_path):
|
||||
with open(image_path, "rb") as image_file:
|
||||
return base64.b64encode(image_file.read()).decode('utf-8')
|
||||
def encode_image(fileobj):
|
||||
return base64.b64encode(fileobj.getvalue()).decode('utf-8')
|
||||
Reference in New Issue
Block a user