mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 21:35:19 +00:00
refac: openai image async gen
This commit is contained in:
parent
bd09b6dbad
commit
d12b6cda4e
1 changed files with 3 additions and 1 deletions
|
|
@ -470,7 +470,9 @@ async def image_generations(
|
||||||
"response_format": "b64_json",
|
"response_format": "b64_json",
|
||||||
}
|
}
|
||||||
|
|
||||||
r = requests.post(
|
# Use asyncio.to_thread for the requests.post call
|
||||||
|
r = await asyncio.to_thread(
|
||||||
|
requests.post,
|
||||||
url=f"{app.state.config.OPENAI_API_BASE_URL}/images/generations",
|
url=f"{app.state.config.OPENAI_API_BASE_URL}/images/generations",
|
||||||
json=data,
|
json=data,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue