fix
This commit is contained in:
parent
0d1537963c
commit
1243fa4e58
@ -1234,13 +1234,9 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
|
||||
prompt_id = quote(prompt_id)
|
||||
content_type = quote(content_type)
|
||||
|
||||
async with aiofiles.open(file, 'rb') as f:
|
||||
data = await f.read()
|
||||
size = str(len(data))
|
||||
target_url = f"{file_upload_endpoint}?file_name={filename}&run_id={prompt_id}&type={content_type}&version=v2"
|
||||
|
||||
start_time = time.time() # Start timing here
|
||||
logger.info(f"Image size: {size}")
|
||||
logger.info(f"Target URL: {target_url}")
|
||||
result = await async_request_with_retry("GET", target_url, disable_timeout=True, token=token)
|
||||
end_time = time.time() # End timing after the request is complete
|
||||
@ -1249,6 +1245,12 @@ async def upload_file(prompt_id, filename, subfolder=None, content_type="image/p
|
||||
|
||||
logger.info(f"Result: {ok}")
|
||||
|
||||
async with aiofiles.open(file, 'rb') as f:
|
||||
data = await f.read()
|
||||
|
||||
size = str(len(data))
|
||||
logger.info(f"Image size: {size}")
|
||||
|
||||
start_time = time.time() # Start timing here
|
||||
headers = {
|
||||
"Content-Type": content_type,
|
||||
|
Loading…
x
Reference in New Issue
Block a user