hafsaabd82 commited on
Commit
dfe6aca
·
verified ·
1 Parent(s): ac328d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -34,6 +34,8 @@ except ImportError:
34
  pass
35
  device = "cuda" if torch.cuda.is_available() else "cpu"
36
  token = os.environ.get("HF_TOKEN")
 
 
37
  perform_diarization = bool(token)
38
  model_name = "tiny"
39
  class TimelineItem(BaseModel):
@@ -339,4 +341,7 @@ async def upload_file(audio_file: UploadFile = File(...), rttm_file: UploadFile
339
  os.remove(rttm_path)
340
  end_time = time.time()
341
  print(f"API Request processed in {end_time - start_time:.2f} seconds.")
 
 
 
342
 
 
34
  pass
35
  device = "cuda" if torch.cuda.is_available() else "cpu"
36
  token = os.environ.get("HF_TOKEN")
37
+ if not token:
38
+ print("Warning: HF_TOKEN not set. Diarization will be skipped.")
39
  perform_diarization = bool(token)
40
  model_name = "tiny"
41
  class TimelineItem(BaseModel):
 
341
  os.remove(rttm_path)
342
  end_time = time.time()
343
  print(f"API Request processed in {end_time - start_time:.2f} seconds.")
344
+ @app.get("/")
345
+ def root():
346
+ return {"message": "Audio Analyzer Backend is running."}
347