rm-dev-null commited on
Commit
13f2ee3
·
verified ·
1 Parent(s): 4693fee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -59,11 +59,10 @@ async def identify_track(shazam, audio_chunk, temp_dir):
59
  return f"Fehler bei der Identifizierung des Tracks: {str(e)}"
60
 
61
  async def process_dj_set(track_url, progress=gr.Progress()):
62
- output_directory = "/tmp" # Verwenden Sie tempfile für temporäre Verzeichnisse
63
- output_path = os.path.join(output_directory, 'track.wav')
64
- tracklist_path = os.path.join(temp_dir, 'tracklist.txt')
65
- status_messages = []
66
-
67
  # Überprüfen Sie die Umgebungsvariablen
68
  if not client_id or not client_secret or not token:
69
  return "", "", "Umgebungsvariablen sind nicht gesetzt."
 
59
  return f"Fehler bei der Identifizierung des Tracks: {str(e)}"
60
 
61
  async def process_dj_set(track_url, progress=gr.Progress()):
62
+ with tempfile.TemporaryDirectory() as temp_dir: # Use a temporary directory
63
+ output_path = os.path.join(temp_dir, 'track.wav')
64
+ tracklist_path = os.path.join(temp_dir, 'tracklist.txt')
65
+ status_messages = []
 
66
  # Überprüfen Sie die Umgebungsvariablen
67
  if not client_id or not client_secret or not token:
68
  return "", "", "Umgebungsvariablen sind nicht gesetzt."