FFomy commited on
Commit
53e59e8
·
verified ·
1 Parent(s): 281626b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -101,8 +101,8 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(
101
 
102
 
103
  # Check for CUDA availability
104
- device = "cuda:0" if torch.cuda.is_available() else "cpu"
105
- logging.info(f"Using device: {device}")
106
 
107
  def download_audio(url, method_choice, proxy_url, proxy_username, proxy_password):
108
  """
@@ -414,6 +414,9 @@ def get_model_options(pipeline_type):
414
  # Dictionary to store loaded models
415
  loaded_models = {}
416
 
 
 
 
417
  @spaces.GPU(duration=40)
418
  def transcribe_audio(audio_input, audio_url, proxy_url, proxy_username, proxy_password, pipeline_type, model_id, download_method, start_time=None, end_time=None, verbose=False):
419
  """
@@ -435,6 +438,9 @@ def transcribe_audio(audio_input, audio_url, proxy_url, proxy_username, proxy_pa
435
  Yields:
436
  Tuple[str, str, str or None]: Metrics and messages, transcription text, path to transcription file.
437
  """
 
 
 
438
  try:
439
  if verbose:
440
  logging.getLogger().setLevel(logging.INFO)
 
101
 
102
 
103
  # Check for CUDA availability
104
+ # device = "cuda:0" if torch.cuda.is_available() else "cpu"
105
+ # logging.info(f"Using device: {device}")
106
 
107
  def download_audio(url, method_choice, proxy_url, proxy_username, proxy_password):
108
  """
 
414
  # Dictionary to store loaded models
415
  loaded_models = {}
416
 
417
+ def get_model_from_cache
418
+
419
+
420
  @spaces.GPU(duration=40)
421
  def transcribe_audio(audio_input, audio_url, proxy_url, proxy_username, proxy_password, pipeline_type, model_id, download_method, start_time=None, end_time=None, verbose=False):
422
  """
 
438
  Yields:
439
  Tuple[str, str, str or None]: Metrics and messages, transcription text, path to transcription file.
440
  """
441
+ current_device = "cuda:0" if torch.cuda.is_available() else "cpu"
442
+ device = current_device
443
+ logging.info(f"Using device: {device}")
444
  try:
445
  if verbose:
446
  logging.getLogger().setLevel(logging.INFO)