Stylesaniswi commited on
Commit
788a31a
·
verified ·
1 Parent(s): 4e3b66c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ import torch
4
  import soundfile as sf
5
 
6
  # Load model and tokenizer
7
- device = torch.device('cpu')
8
  model_name = "model_hubert_finetuned_nopeft.pth" # Replace with your model path or Hugging Face model hub path
9
  config = HubertConfig.from_pretrained("superb/hubert-large-superb-er")
10
  config.id2label = {0: 'neu', 1: 'hap', 2: 'ang', 3: 'sad', 4: 'dis', 5: 'sur', 6: 'fea', 7: 'cal'}
 
4
  import soundfile as sf
5
 
6
  # Load model and tokenizer
7
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
8
  model_name = "model_hubert_finetuned_nopeft.pth" # Replace with your model path or Hugging Face model hub path
9
  config = HubertConfig.from_pretrained("superb/hubert-large-superb-er")
10
  config.id2label = {0: 'neu', 1: 'hap', 2: 'ang', 3: 'sad', 4: 'dis', 5: 'sur', 6: 'fea', 7: 'cal'}