Skip to content

Commit

Permalink
ci: auto fixes from pre-commit.ci
Browse files Browse the repository at this point in the history
For more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 26, 2024
1 parent 421942e commit 1968d5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/io-descriptors/requirements.txt
Expand Up @@ -5,4 +5,4 @@ torch
accelerate
pydub
pdf2img
pandas
pandas
6 changes: 4 additions & 2 deletions examples/io-descriptors/service.py
Expand Up @@ -75,10 +75,12 @@ def speed_up_audio(
audio: t.Annotated[Path, bentoml.validators.ContentType("audio/mpeg")],
velocity: float,
) -> t.Annotated[Path, bentoml.validators.ContentType("audio/mp3")]:
from pydub import AudioSegment
import os

from pydub import AudioSegment

output_path = os.path.join(context.temp_dir, "output.mp3")
sound = AudioSegment.from_file(audio)
sound = AudioSegment.from_file(audio)
sound = sound.speedup(velocity)
sound.export(output_path, format="mp3")
return Path(output_path)
Expand Down

0 comments on commit 1968d5b

Please sign in to comment.