mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-01 03:21:02 +00:00
commit
693b15231d
@ -3,17 +3,14 @@ from __future__ import annotations
|
|||||||
import string
|
import string
|
||||||
import random
|
import random
|
||||||
import json
|
import json
|
||||||
import io
|
|
||||||
import base64
|
|
||||||
import math
|
import math
|
||||||
from PIL import Image
|
|
||||||
from ...typing import ImageType
|
from ...typing import ImageType
|
||||||
from aiohttp import ClientSession
|
from aiohttp import ClientSession
|
||||||
from ...image import to_image, process_image, to_base64
|
from ...image import to_image, process_image, to_base64
|
||||||
|
|
||||||
image_config = {
|
image_config = {
|
||||||
"maxImagePixels": 360000,
|
"maxImagePixels": 360000,
|
||||||
"imageComp.ssionRate": 0.7,
|
"imageCompressionRate": 0.7,
|
||||||
"enableFaceBlurDebug": 0,
|
"enableFaceBlurDebug": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,8 @@ class Backend_Api:
|
|||||||
'provider': get_last_provider(True)
|
'provider': get_last_provider(True)
|
||||||
}) + "\n"
|
}) + "\n"
|
||||||
if isinstance(chunk, Exception):
|
if isinstance(chunk, Exception):
|
||||||
yield json.dumps({
|
logging.exception(chunk)
|
||||||
|
yield json.dumps({
|
||||||
'type' : 'message',
|
'type' : 'message',
|
||||||
'message': get_error_message(chunk),
|
'message': get_error_message(chunk),
|
||||||
}) + "\n"
|
}) + "\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user