Consulawtech commited on
Commit
f8a6bfe
·
verified ·
1 Parent(s): ff28993

Fix torchaudio deprecation warning; Supabase secrets added

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -13,6 +13,7 @@ import os
13
  import uuid
14
  import argparse
15
  import logging
 
16
  from concurrent.futures import ThreadPoolExecutor
17
  from typing import Optional
18
  import uvicorn
@@ -20,6 +21,14 @@ from fastapi import FastAPI, Request, UploadFile, File, Form, HTTPException
20
  from fastapi.responses import JSONResponse, Response
21
  from fastapi.middleware.cors import CORSMiddleware
22
 
 
 
 
 
 
 
 
 
23
  try:
24
  import requests as _requests
25
  _requests_available = True
 
13
  import uuid
14
  import argparse
15
  import logging
16
+ import warnings
17
  from concurrent.futures import ThreadPoolExecutor
18
  from typing import Optional
19
  import uvicorn
 
21
  from fastapi.responses import JSONResponse, Response
22
  from fastapi.middleware.cors import CORSMiddleware
23
 
24
+ # pyannote.audio calls torchaudio.set_audio_backend() which is a no-op in
25
+ # torchaudio 2.x (dispatcher always enabled). Suppress the UserWarning it emits.
26
+ warnings.filterwarnings(
27
+ "ignore",
28
+ message="torchaudio._backend.set_audio_backend has been deprecated",
29
+ category=UserWarning,
30
+ )
31
+
32
  try:
33
  import requests as _requests
34
  _requests_available = True