Alidr79 commited on
Commit
f7906d2
1 Parent(s): 07601c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -7,6 +7,7 @@ from datasets import load_dataset
7
  from tqdm import tqdm
8
  import soundfile as sf
9
  import librosa
 
10
 
11
  dataset = load_dataset('pourmand1376/asr-farsi-youtube-chunked-10-seconds', split = "test")
12
 
@@ -42,11 +43,15 @@ import librosa
42
 
43
 
44
  def set_seed(seed):
45
- torch.manual_seed(seed)
46
- if torch.cuda.is_available():
47
- torch.cuda.manual_seed_all(seed)
48
-
49
- set_seed(42)
 
 
 
 
50
  # Load model directly
51
  from transformers import AutoProcessor, AutoModelForTextToSpectrogram
52
 
 
7
  from tqdm import tqdm
8
  import soundfile as sf
9
  import librosa
10
+ import random
11
 
12
  dataset = load_dataset('pourmand1376/asr-farsi-youtube-chunked-10-seconds', split = "test")
13
 
 
43
 
44
 
45
  def set_seed(seed):
46
+ torch.manual_seed(seed)
47
+ if torch.cuda.is_available():
48
+ torch.cuda.manual_seed_all(seed)
49
+ np.random.seed(seed)
50
+ random.seed(seed)
51
+ torch.backends.cudnn.deterministic = True
52
+ torch.backends.cudnn.benchmark = False
53
+
54
+ set_seed(1)
55
  # Load model directly
56
  from transformers import AutoProcessor, AutoModelForTextToSpectrogram
57