reedmayhew commited on
Commit
5a0e518
·
verified ·
1 Parent(s): 5d0e917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -42,18 +42,11 @@ def create_pipe(model, flash):
42
  )
43
  return pipe, model # Return both pipe and model for later GPU switch
44
 
45
- @spaces.GPU
46
  def move_to_gpu(model):
47
- if torch.cuda.is_available():
48
- device = "cuda:0"
49
- torch_dtype = torch.float16 # Use float16 precision on GPU
50
- model.to(device, dtype=torch_dtype)
51
- elif platform == "darwin":
52
- device = "mps"
53
- model.to(device)
54
- else:
55
- device = "cpu"
56
-
57
  return device
58
 
59
  def transcribe_webui_simple_progress(modelName, languageName, urlData, multipleFiles, microphoneData, task, flash,
 
42
  )
43
  return pipe, model # Return both pipe and model for later GPU switch
44
 
45
+ @spaces.GPU(duration=120)
46
  def move_to_gpu(model):
47
+ device = "cuda:0"
48
+ torch_dtype = torch.float16 # Use float16 precision on GPU
49
+ model.to(device, dtype=torch_dtype)
 
 
 
 
 
 
 
50
  return device
51
 
52
  def transcribe_webui_simple_progress(modelName, languageName, urlData, multipleFiles, microphoneData, task, flash,