Update evaluate.py
Browse files- evaluate.py +5 -5
evaluate.py
CHANGED
@@ -172,11 +172,11 @@ def init_reference_audio(reference_dir, output_dir):
|
|
172 |
except Exception as e:
|
173 |
logger.warning(f"β οΈ Failed to copy reference files: {str(e)}")
|
174 |
|
175 |
-
# Log the final contents, excluding dummy files
|
176 |
pattern_dirs = [d for d in os.listdir(working_dir)
|
177 |
if os.path.isdir(os.path.join(working_dir, d))]
|
178 |
-
logger.info(f"π Final reference directory has {len(pattern_dirs)} pattern directories")
|
179 |
|
|
|
180 |
total_wav_files = 0
|
181 |
for pattern in pattern_dirs:
|
182 |
pattern_path = os.path.join(working_dir, pattern)
|
@@ -184,9 +184,10 @@ def init_reference_audio(reference_dir, output_dir):
|
|
184 |
# Count only non-dummy files
|
185 |
valid_files = [f for f in wav_files if "dummy_reference" not in f]
|
186 |
total_wav_files += len(valid_files)
|
187 |
-
|
|
|
188 |
|
189 |
-
logger.info(f"π Total reference WAV files: {total_wav_files}")
|
190 |
|
191 |
# Check for and remove any dummy files
|
192 |
for pattern in pattern_dirs:
|
@@ -215,7 +216,6 @@ def init_reference_audio(reference_dir, output_dir):
|
|
215 |
except:
|
216 |
logger.critical("π₯ CRITICAL: Failed to create even a fallback directory")
|
217 |
return reference_dir
|
218 |
-
|
219 |
def handle_upload_reference(request, reference_dir, sample_rate):
|
220 |
"""Handle upload of reference audio files"""
|
221 |
try:
|
|
|
172 |
except Exception as e:
|
173 |
logger.warning(f"β οΈ Failed to copy reference files: {str(e)}")
|
174 |
|
175 |
+
# Log the final contents, excluding dummy files - MODIFIED HERE
|
176 |
pattern_dirs = [d for d in os.listdir(working_dir)
|
177 |
if os.path.isdir(os.path.join(working_dir, d))]
|
|
|
178 |
|
179 |
+
# Count total files without logging each directory
|
180 |
total_wav_files = 0
|
181 |
for pattern in pattern_dirs:
|
182 |
pattern_path = os.path.join(working_dir, pattern)
|
|
|
184 |
# Count only non-dummy files
|
185 |
valid_files = [f for f in wav_files if "dummy_reference" not in f]
|
186 |
total_wav_files += len(valid_files)
|
187 |
+
# Remove the individual directory logging
|
188 |
+
# logger.info(f" - {pattern}: {len(valid_files)} valid WAV files")
|
189 |
|
190 |
+
logger.info(f"π Total pattern directories: {len(pattern_dirs)}, Total reference WAV files: {total_wav_files}")
|
191 |
|
192 |
# Check for and remove any dummy files
|
193 |
for pattern in pattern_dirs:
|
|
|
216 |
except:
|
217 |
logger.critical("π₯ CRITICAL: Failed to create even a fallback directory")
|
218 |
return reference_dir
|
|
|
219 |
def handle_upload_reference(request, reference_dir, sample_rate):
|
220 |
"""Handle upload of reference audio files"""
|
221 |
try:
|