Код: Выделить всё
import openai
openai.api_key = ''
def process_image(file_path):
# Open the image file
with open(file_path, "rb") as image_file:
response = openai.Image.create(
file=image_file,
prompt="Translate any text from this image into German"
)
print(response['choices'][0]['text'])
process_image('1.PNG')
TypeError: объект типа BufferedReader не является сериализуемым в формате JSON
< /blockquote>
Подробнее здесь: https://stackoverflow.com/questions/790 ... openai-api