Fix some tests and allow running the docker container offline

This commit is contained in:
Fireblade 2025-02-22 15:17:28 -05:00
parent c1207f085b
commit 5de3cace3b
5 changed files with 9 additions and 9 deletions

View file

@ -23,7 +23,7 @@ text="""Delving into the Abyss: A Deeper Exploration of Meaning in 5 Seconds of
5 Seconds of Summer, initially perceived as purveyors of upbeat, radio-friendly pop-punk, embarked on a significant artistic evolution with their album Sounds Good Feels Good. Among its tracks, "Jet Black Heart" stands out as a powerful testament to this shift, moving beyond catchy melodies and embracing a darker, more emotionally complex sound. Released in 2015, the song transcends the typical themes of youthful exuberance and romantic angst, instead plunging into the depths of personal turmoil and the corrosive effects of inner darkness on interpersonal relationships. "Jet Black Heart" is not merely a song about heartbreak; it is a raw and vulnerable exploration of internal struggle, self-destructive patterns, and the precarious flicker of hope that persists even in the face of profound emotional chaos."""
Type="aac"
Type="wav"
response = requests.post(

View file

@ -32,7 +32,7 @@ async def test_convert_to_wav(sample_audio):
audio_data, sample_rate = sample_audio
# Write and finalize in one step for WAV
audio_chunk = await AudioService.convert_audio(
AudioChunk(audio_data), sample_rate, "wav", is_first_chunk=True, is_last_chunk=True
AudioChunk(audio_data), sample_rate, "wav", is_first_chunk=True, is_last_chunk=False
)
assert isinstance(audio_chunk.output, bytes)
assert isinstance(audio_chunk, AudioChunk)
@ -85,11 +85,11 @@ async def test_convert_to_flac(sample_audio):
@pytest.mark.asyncio
async def test_convert_to_m4a(sample_audio):
async def test_convert_to_aac(sample_audio):
"""Test converting to M4A format"""
audio_data, sample_rate = sample_audio
audio_chunk = await AudioService.convert_audio(
AudioChunk(audio_data), sample_rate, "m4a"
AudioChunk(audio_data), sample_rate, "aac"
)
assert isinstance(audio_chunk.output, bytes)
assert isinstance(audio_chunk, AudioChunk)
@ -127,7 +127,7 @@ async def test_normalization_wav(sample_audio):
large_audio = audio_data * 1e5
# Write and finalize in one step for WAV
audio_chunk = await AudioService.convert_audio(
AudioChunk(large_audio), sample_rate, "wav", is_first_chunk=True, is_last_chunk=True
AudioChunk(large_audio), sample_rate, "wav", is_first_chunk=True
)
assert isinstance(audio_chunk.output, bytes)
assert isinstance(audio_chunk, AudioChunk)
@ -165,7 +165,7 @@ async def test_different_sample_rates(sample_audio):
for rate in sample_rates:
audio_chunk = await AudioService.convert_audio(
AudioChunk(audio_data), rate, "wav", is_first_chunk=True, is_last_chunk=True
AudioChunk(audio_data), rate, "wav", is_first_chunk=True
)
assert isinstance(audio_chunk.output, bytes)
assert isinstance(audio_chunk, AudioChunk)

View file

@ -5,4 +5,4 @@ if [ "$DOWNLOAD_MODEL" = "true" ]; then
python download_model.py --output api/src/models/v1_0
fi
exec uv run --extra $DEVICE python -m uvicorn api.src.main:app --host 0.0.0.0 --port 8880 --log-level debug
exec uv run --extra $DEVICE --no-sync python -m uvicorn api.src.main:app --host 0.0.0.0 --port 8880 --log-level debug

View file

@ -14,4 +14,4 @@ export WEB_PLAYER_PATH=$PROJECT_ROOT/web
# Run FastAPI with CPU extras using uv run
# Note: espeak may still require manual installation,
uv pip install -e ".[cpu]"
uv run uvicorn api.src.main:app --host 0.0.0.0 --port 8880
uv run --no-sync uvicorn api.src.main:app --host 0.0.0.0 --port 8880

View file

@ -13,4 +13,4 @@ export WEB_PLAYER_PATH=$PROJECT_ROOT/web
# Run FastAPI with GPU extras using uv run
uv pip install -e ".[gpu]"
uv run uvicorn api.src.main:app --host 0.0.0.0 --port 8880
uv run --no-sync uvicorn api.src.main:app --host 0.0.0.0 --port 8880