Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -124,7 +124,7 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
|
|
124 |
"--genre_txt", f"{genre_txt_path}",
|
125 |
"--lyrics_txt", f"{lyrics_txt_path}",
|
126 |
"--run_n_segments", f"{num_segments}",
|
127 |
-
"--stage2_batch_size", "
|
128 |
"--output_dir", f"{output_dir}",
|
129 |
"--cuda_idx", "0",
|
130 |
"--max_new_tokens", f"{max_new_tokens}",
|
@@ -135,13 +135,9 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
|
|
135 |
env = os.environ.copy()
|
136 |
env.update({
|
137 |
"CUDA_VISIBLE_DEVICES": "0",
|
138 |
-
"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:512",
|
139 |
"CUDA_HOME": "/usr/local/cuda",
|
140 |
"PATH": f"/usr/local/cuda/bin:{env.get('PATH', '')}",
|
141 |
-
"LD_LIBRARY_PATH": f"/usr/local/cuda/lib64:{env.get('LD_LIBRARY_PATH', '')}"
|
142 |
-
"PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:512,garbage_collection_threshold:0.8", # Added garbage collection threshold
|
143 |
-
"TORCH_DISTRIBUTED_DEBUG": "DETAIL", # Added for better debugging
|
144 |
-
"CUDA_LAUNCH_BLOCKING": "0" # Ensure asynchronous CUDA operations
|
145 |
})
|
146 |
|
147 |
# Execute the command
|
|
|
124 |
"--genre_txt", f"{genre_txt_path}",
|
125 |
"--lyrics_txt", f"{lyrics_txt_path}",
|
126 |
"--run_n_segments", f"{num_segments}",
|
127 |
+
"--stage2_batch_size", "2",
|
128 |
"--output_dir", f"{output_dir}",
|
129 |
"--cuda_idx", "0",
|
130 |
"--max_new_tokens", f"{max_new_tokens}",
|
|
|
135 |
env = os.environ.copy()
|
136 |
env.update({
|
137 |
"CUDA_VISIBLE_DEVICES": "0",
|
|
|
138 |
"CUDA_HOME": "/usr/local/cuda",
|
139 |
"PATH": f"/usr/local/cuda/bin:{env.get('PATH', '')}",
|
140 |
+
"LD_LIBRARY_PATH": f"/usr/local/cuda/lib64:{env.get('LD_LIBRARY_PATH', '')}"
|
|
|
|
|
|
|
141 |
})
|
142 |
|
143 |
# Execute the command
|