This commit is contained in:
Timothy Jaeryang Baek
2026-02-15 17:55:59 -06:00
parent e1b3e7252c
commit 319d3e8856
2 changed files with 24 additions and 22 deletions
+16 -15
View File
@@ -228,22 +228,23 @@ async def upload_pipeline(
headers = {"Authorization": f"Bearer {key}"}
async with aiohttp.ClientSession(trust_env=True) as session:
form_data = aiohttp.FormData()
form_data.add_field(
"file",
open(file_path, "rb"),
filename=filename,
content_type="application/octet-stream",
)
with open(file_path, "rb") as f:
form_data = aiohttp.FormData()
form_data.add_field(
"file",
f,
filename=filename,
content_type="application/octet-stream",
)
async with session.post(
f"{url}/pipelines/upload",
headers=headers,
data=form_data,
ssl=AIOHTTP_CLIENT_SESSION_SSL,
) as response:
response.raise_for_status()
data = await response.json()
async with session.post(
f"{url}/pipelines/upload",
headers=headers,
data=form_data,
ssl=AIOHTTP_CLIENT_SESSION_SSL,
) as response:
response.raise_for_status()
data = await response.json()
return {**data}
except Exception as e: