Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion audio_separator/remote/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,14 @@ def separate_audio(

try:
# Increase timeout for large files (5 minutes)
# When using gcs_uri (no file upload), we still need multipart/form-data
# encoding because FastAPI requires it for endpoints with File()/Form() params.
# Passing a dummy empty file field forces requests to use multipart encoding.
if not files:
files = {"file": ("", b"", "application/octet-stream")}
response = self.session.post(
f"{self.api_url}/separate",
files=files if files else None,
files=files,
data=data,
timeout=300,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "audio-separator"
version = "0.44.0"
version = "0.44.1"
description = "Easy to use audio stem separation, using various models from UVR trained primarily by @Anjok07"
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
license = "MIT"
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test_remote_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,10 @@ def test_separate_audio_with_gcs_uri(self, mock_post, api_client):

assert result["task_id"] == "test-task-gcs"

# Verify gcs_uri was sent in form data, no file upload
# Verify gcs_uri was sent in form data
call_args = mock_post.call_args
assert call_args[1]["files"] is None
# A dummy empty file is sent to force multipart encoding (FastAPI requires it)
assert call_args[1]["files"]["file"][0] == "" # empty filename
assert call_args[1]["data"]["gcs_uri"] == "gs://my-bucket/path/to/audio.flac"

def test_separate_audio_requires_file_or_gcs_uri(self, api_client):
Expand Down
Loading