ginipick commited on
Commit
0c540a1
ยท
verified ยท
1 Parent(s): 0c6f8b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -275,6 +275,7 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
275
  os.makedirs(output_dir, exist_ok=True)
276
  empty_output_folder(output_dir)
277
 
 
278
  command = [
279
  "python", "infer.py",
280
  "--stage1_model", model_path,
@@ -286,9 +287,7 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
286
  "--output_dir", output_dir,
287
  "--cuda_idx", "0",
288
  "--max_new_tokens", str(actual_max_tokens),
289
- "--use_flash_attention", "True",
290
- "--use_bettertransformer", "True",
291
- "--use_compile", "True"
292
  ]
293
 
294
  env = os.environ.copy()
@@ -299,10 +298,16 @@ def infer(genre_txt_content, lyrics_txt_content, num_segments, max_new_tokens):
299
  "PATH": f"/usr/local/cuda/bin:{env.get('PATH', '')}",
300
  "LD_LIBRARY_PATH": f"/usr/local/cuda/lib64:{env.get('LD_LIBRARY_PATH', '')}",
301
  "PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:512",
302
- "CUDA_LAUNCH_BLOCKING": "0",
303
- "TORCH_DISTRIBUTED_DEBUG": "DETAIL"
304
  })
305
 
 
 
 
 
 
 
 
306
  process = subprocess.run(
307
  command,
308
  env=env,
 
275
  os.makedirs(output_dir, exist_ok=True)
276
  empty_output_folder(output_dir)
277
 
278
+ # ์ˆ˜์ •๋œ command - ์ง€์›๋˜์ง€ ์•Š๋Š” ์ธ์ˆ˜ ์ œ๊ฑฐ
279
  command = [
280
  "python", "infer.py",
281
  "--stage1_model", model_path,
 
287
  "--output_dir", output_dir,
288
  "--cuda_idx", "0",
289
  "--max_new_tokens", str(actual_max_tokens),
290
+ "--disable_offload_model" # GPU ๋ฉ”๋ชจ๋ฆฌ ์ตœ์ ํ™”๋ฅผ ์œ„ํ•ด ์ถ”๊ฐ€
 
 
291
  ]
292
 
293
  env = os.environ.copy()
 
298
  "PATH": f"/usr/local/cuda/bin:{env.get('PATH', '')}",
299
  "LD_LIBRARY_PATH": f"/usr/local/cuda/lib64:{env.get('LD_LIBRARY_PATH', '')}",
300
  "PYTORCH_CUDA_ALLOC_CONF": "max_split_size_mb:512",
301
+ "CUDA_LAUNCH_BLOCKING": "0"
 
302
  })
303
 
304
+ # transformers ์บ์‹œ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ์ฒ˜๋ฆฌ
305
+ try:
306
+ from transformers.utils import move_cache
307
+ move_cache()
308
+ except Exception as e:
309
+ logging.warning(f"Cache migration warning (non-critical): {e}")
310
+
311
  process = subprocess.run(
312
  command,
313
  env=env,