yourmt3 fix 6
Browse files
backend/yourmt3_wrapper.py
CHANGED
|
@@ -10,6 +10,7 @@ Based on: https://huggingface.co/spaces/mimbres/YourMT3
|
|
| 10 |
|
| 11 |
import sys
|
| 12 |
import os
|
|
|
|
| 13 |
from pathlib import Path
|
| 14 |
from typing import Optional
|
| 15 |
|
|
@@ -192,10 +193,10 @@ class YourMT3Transcriber:
|
|
| 192 |
midi_path = transcribe(self.model, audio_info)
|
| 193 |
midi_path = Path(midi_path)
|
| 194 |
|
| 195 |
-
# Move to output directory if needed
|
| 196 |
if midi_path.parent != output_dir:
|
| 197 |
final_path = output_dir / midi_path.name
|
| 198 |
-
|
| 199 |
midi_path = final_path
|
| 200 |
|
| 201 |
print(f"Transcription complete: {midi_path}")
|
|
|
|
| 10 |
|
| 11 |
import sys
|
| 12 |
import os
|
| 13 |
+
import shutil
|
| 14 |
from pathlib import Path
|
| 15 |
from typing import Optional
|
| 16 |
|
|
|
|
| 193 |
midi_path = transcribe(self.model, audio_info)
|
| 194 |
midi_path = Path(midi_path)
|
| 195 |
|
| 196 |
+
# Move to output directory if needed (use shutil.move for cross-filesystem support)
|
| 197 |
if midi_path.parent != output_dir:
|
| 198 |
final_path = output_dir / midi_path.name
|
| 199 |
+
shutil.move(str(midi_path), str(final_path))
|
| 200 |
midi_path = final_path
|
| 201 |
|
| 202 |
print(f"Transcription complete: {midi_path}")
|