PierrunoYT commited on
Commit
d08d0d5
·
1 Parent(s): 0ff89a1

Set DeepSpeed environment variables to prevent CUDA compilation issues on Windows

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -1,8 +1,15 @@
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  import torch
3
  import llava
4
  from peft import PeftModel
5
- import os
6
  from huggingface_hub import snapshot_download
7
 
8
 
 
1
+ import os
2
+ # CRITICAL: Set DeepSpeed environment variables BEFORE any imports
3
+ # This prevents DeepSpeed from trying to compile CUDA ops on Windows
4
+ os.environ['DS_BUILD_OPS'] = '0'
5
+ os.environ['DS_BUILD_AIO'] = '0'
6
+ os.environ['DS_BUILD_FUSED_ADAM'] = '0'
7
+ os.environ['DS_BUILD_SPARSE_ATTN'] = '0'
8
+
9
  import gradio as gr
10
  import torch
11
  import llava
12
  from peft import PeftModel
 
13
  from huggingface_hub import snapshot_download
14
 
15