From dacb6cc64dc404c56be15c26d828631837208d9a Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Thu, 25 Jul 2024 20:11:41 +0530
Subject: [PATCH 1/9] Update requirements.txt

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index 60c193b0a..cd95b0ef5 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-torch==1.4.0
+torch==1.11.0
 numpy==1.17.4
 librosa==0.7.2
 scipy==1.4.1

From 269825bd53b09839a7ce23a38ab0b5e52bc5a8da Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Thu, 25 Jul 2024 20:16:34 +0530
Subject: [PATCH 2/9] Update requirements.txt

---
 requirements.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index cd95b0ef5..516a06727 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
-torch==1.11.0
-numpy==1.17.4
-librosa==0.7.2
-scipy==1.4.1
-tensorboard==2.0
-soundfile==0.10.3.post1
-matplotlib==3.1.3
\ No newline at end of file
+torch
+numpy
+librosa
+scipy
+tensorboard
+soundfile
+matplotlib
\ No newline at end of file

From 6ccadbc21784e969134ea308dbfb8587442fb5fc Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Thu, 25 Jul 2024 21:12:07 +0530
Subject: [PATCH 3/9] Update requirements.txt

---
 requirements.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 516a06727..f5162f25c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
 torch
-numpy
-librosa
-scipy
-tensorboard
-soundfile
-matplotlib
\ No newline at end of file
+numpy==1.17.4
+librosa==0.7.2
+scipy==1.4.1
+tensorboard==2.0
+soundfile==0.10.3.post1
+matplotlib==3.1.3
\ No newline at end of file

From 65ba52182f615139efa5708749a0e12aefbda879 Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Thu, 25 Jul 2024 21:15:35 +0530
Subject: [PATCH 4/9] Update requirements.txt

---
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/requirements.txt b/requirements.txt
index f5162f25c..cc1af6ed9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 torch
-numpy==1.17.4
+numpy==1.19.5
 librosa==0.7.2
 scipy==1.4.1
 tensorboard==2.0

From 63efd8d13f6e9635143bac763383ba7500e204f8 Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Fri, 26 Jul 2024 02:55:53 +0530
Subject: [PATCH 5/9] Update requirements.txt

---
 requirements.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index cc1af6ed9..516a06727 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
 torch
-numpy==1.19.5
-librosa==0.7.2
-scipy==1.4.1
-tensorboard==2.0
-soundfile==0.10.3.post1
-matplotlib==3.1.3
\ No newline at end of file
+numpy
+librosa
+scipy
+tensorboard
+soundfile
+matplotlib
\ No newline at end of file

From 98268f4f0b8e55e40661d91ccbb5fba1549c19ea Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Fri, 26 Jul 2024 12:00:15 +0530
Subject: [PATCH 6/9] Update requirements.txt

---
 requirements.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 516a06727..60c193b0a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
-torch
-numpy
-librosa
-scipy
-tensorboard
-soundfile
-matplotlib
\ No newline at end of file
+torch==1.4.0
+numpy==1.17.4
+librosa==0.7.2
+scipy==1.4.1
+tensorboard==2.0
+soundfile==0.10.3.post1
+matplotlib==3.1.3
\ No newline at end of file

From ba60086a53df465735f8bd22b6fde879a7036192 Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Fri, 26 Jul 2024 12:28:54 +0530
Subject: [PATCH 7/9] Create environment.yml

---
 environment.yml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 environment.yml

diff --git a/environment.yml b/environment.yml
new file mode 100644
index 000000000..3e9ddb4d3
--- /dev/null
+++ b/environment.yml
@@ -0,0 +1,14 @@
+name: hifi-gan
+channels:
+  - defaults
+dependencies:
+  - python=3.8
+  - pip
+  - pip:
+    - torch==1.4.0
+    - numpy==1.17.4
+    - librosa==0.7.2
+    - scipy==1.4.1
+    - tensorboard==2.0
+    - soundfile==0.10.3.post1
+    - matplotlib==3.1.3

From 1b6dc74bed886554d0f9187ab21eb5e2c129c0ac Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Fri, 26 Jul 2024 16:39:20 +0530
Subject: [PATCH 8/9] updated requirements

---
 environment.yml  |  1 -
 requirements.txt | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/environment.yml b/environment.yml
index 3e9ddb4d3..5d83db8db 100644
--- a/environment.yml
+++ b/environment.yml
@@ -2,7 +2,6 @@ name: hifi-gan
 channels:
   - defaults
 dependencies:
-  - python=3.8
   - pip
   - pip:
     - torch==1.4.0
diff --git a/requirements.txt b/requirements.txt
index 60c193b0a..f52980b15 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
-torch==1.4.0
-numpy==1.17.4
-librosa==0.7.2
-scipy==1.4.1
-tensorboard==2.0
-soundfile==0.10.3.post1
-matplotlib==3.1.3
\ No newline at end of file
+torch
+numpy
+librosa
+scipy
+tensorboardX
+soundfile
+matplotlib
\ No newline at end of file

From 3490ea3a830a62e4dae1d766b76bc426623f362e Mon Sep 17 00:00:00 2001
From: Tushar Goyal <92171383+thetushargoyal@users.noreply.github.com>
Date: Sat, 27 Jul 2024 23:18:26 +0530
Subject: [PATCH 9/9] Update meldataset.py

---
 meldataset.py | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/meldataset.py b/meldataset.py
index 450292451..4f6c7fd72 100644
--- a/meldataset.py
+++ b/meldataset.py
@@ -10,42 +10,33 @@
 
 MAX_WAV_VALUE = 32768.0
 
-
 def load_wav(full_path):
     sampling_rate, data = read(full_path)
     return data, sampling_rate
 
-
 def dynamic_range_compression(x, C=1, clip_val=1e-5):
     return np.log(np.clip(x, a_min=clip_val, a_max=None) * C)
 
-
 def dynamic_range_decompression(x, C=1):
     return np.exp(x) / C
 
-
 def dynamic_range_compression_torch(x, C=1, clip_val=1e-5):
     return torch.log(torch.clamp(x, min=clip_val) * C)
 
-
 def dynamic_range_decompression_torch(x, C=1):
     return torch.exp(x) / C
 
-
 def spectral_normalize_torch(magnitudes):
     output = dynamic_range_compression_torch(magnitudes)
     return output
 
-
 def spectral_de_normalize_torch(magnitudes):
     output = dynamic_range_decompression_torch(magnitudes)
     return output
 
-
 mel_basis = {}
 hann_window = {}
 
-
 def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, fmax, center=False):
     if torch.min(y) < -1.:
         print('min value is ', torch.min(y))
@@ -54,7 +45,7 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin,
 
     global mel_basis, hann_window
     if fmax not in mel_basis:
-        mel = librosa_mel_fn(sampling_rate, n_fft, num_mels, fmin, fmax)
+        mel = librosa_mel_fn(sr=sampling_rate, n_fft=n_fft, n_mels=num_mels, fmin=fmin, fmax=fmax)
         mel_basis[str(fmax)+'_'+str(y.device)] = torch.from_numpy(mel).float().to(y.device)
         hann_window[str(y.device)] = torch.hann_window(win_size).to(y.device)
 
@@ -62,16 +53,15 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin,
     y = y.squeeze(1)
 
     spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)],
-                      center=center, pad_mode='reflect', normalized=False, onesided=True)
+                      center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=True)
 
-    spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9))
+    spec = torch.abs(spec)
 
     spec = torch.matmul(mel_basis[str(fmax)+'_'+str(y.device)], spec)
     spec = spectral_normalize_torch(spec)
 
     return spec
 
-
 def get_dataset_filelist(a):
     with open(a.input_training_file, 'r', encoding='utf-8') as fi:
         training_files = [os.path.join(a.input_wavs_dir, x.split('|')[0] + '.wav')
@@ -82,7 +72,6 @@ def get_dataset_filelist(a):
                             for x in fi.read().split('\n') if len(x) > 0]
     return training_files, validation_files
 
-
 class MelDataset(torch.utils.data.Dataset):
     def __init__(self, training_files, segment_size, n_fft, num_mels,
                  hop_size, win_size, sampling_rate,  fmin, fmax, split=True, shuffle=True, n_cache_reuse=1,