Skip to content

Commit

Permalink
migrated to fastapi, which has a BackGroundTasks mechanism built in
Browse files Browse the repository at this point in the history
  • Loading branch information
jblom committed Sep 25, 2024
1 parent dd0fab7 commit 40b80f2
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 466 deletions.
8 changes: 0 additions & 8 deletions apis/__init__.py

This file was deleted.

118 changes: 0 additions & 118 deletions apis/whisper_api.py

This file was deleted.

75 changes: 0 additions & 75 deletions app/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions download.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def http_download(url: str) -> Optional[DownloadResult]:
os.makedirs(input_file_dir)
with open(input_file, "wb") as file:
response = requests.get(url)
if response.status_code >= 400:
logger.error(f"Could not download url: {response.status_code}")
return None
file.write(response.content)
file.close()
download_time = (time.time() - start_time) * 1000 # time in ms
Expand Down
Loading

0 comments on commit 40b80f2

Please sign in to comment.