1inkusFace commited on
Commit
b2f8c47
·
verified ·
1 Parent(s): e5385ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -45,7 +45,6 @@ def load_model():
45
  return model, model_config
46
 
47
  model, model_config = load_model()
48
- model = model.to(device,torch.bfloat16)
49
 
50
  # Function to set up, generate, and process the audio
51
  @spaces.GPU(duration=60) # Allocate GPU only when this function is called
@@ -55,6 +54,8 @@ def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
55
 
56
  device = "cuda" if torch.cuda.is_available() else "cpu"
57
  print(f"Using device: {device}")
 
 
58
 
59
  # Fetch the Hugging Face token from the environment variable
60
  hf_token = os.getenv('HF_TOKEN')
 
45
  return model, model_config
46
 
47
  model, model_config = load_model()
 
48
 
49
  # Function to set up, generate, and process the audio
50
  @spaces.GPU(duration=60) # Allocate GPU only when this function is called
 
54
 
55
  device = "cuda" if torch.cuda.is_available() else "cpu"
56
  print(f"Using device: {device}")
57
+
58
+ model = model.to(device,torch.bfloat16)
59
 
60
  # Fetch the Hugging Face token from the environment variable
61
  hf_token = os.getenv('HF_TOKEN')