Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- app/main.py +7 -1
app/main.py
CHANGED
|
@@ -300,12 +300,18 @@ async def audio_transcriptions(
|
|
| 300 |
if prompt:
|
| 301 |
data["prompt"] = prompt
|
| 302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
async with httpx.AsyncClient(timeout=timeout) as client:
|
| 304 |
resp = await client.post(
|
| 305 |
upstream_url,
|
| 306 |
files=files,
|
| 307 |
data=data,
|
| 308 |
-
headers=
|
| 309 |
)
|
| 310 |
|
| 311 |
return JSONResponse(status_code=resp.status_code, content=resp.json())
|
|
|
|
| 300 |
if prompt:
|
| 301 |
data["prompt"] = prompt
|
| 302 |
|
| 303 |
+
safe_headers = {
|
| 304 |
+
k: v
|
| 305 |
+
for k, v in headers_with_auth.items()
|
| 306 |
+
if k.lower() != "content-type"
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
async with httpx.AsyncClient(timeout=timeout) as client:
|
| 310 |
resp = await client.post(
|
| 311 |
upstream_url,
|
| 312 |
files=files,
|
| 313 |
data=data,
|
| 314 |
+
headers=safe_headers
|
| 315 |
)
|
| 316 |
|
| 317 |
return JSONResponse(status_code=resp.status_code, content=resp.json())
|