Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,15 @@
|
|
| 1 |
import spaces
|
| 2 |
import os
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 5 |
-
os.putenv(
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
import numpy as np
|
|
@@ -34,8 +41,8 @@ torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
|
| 34 |
torch.backends.cudnn.allow_tf32 = False
|
| 35 |
torch.backends.cudnn.deterministic = False
|
| 36 |
torch.backends.cudnn.benchmark = False
|
| 37 |
-
|
| 38 |
-
|
| 39 |
torch.set_float32_matmul_precision("highest")
|
| 40 |
|
| 41 |
hftoken = os.getenv("HF_AUTH_TOKEN")
|
|
|
|
| 1 |
import spaces
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
os.putenv('PYTORCH_NVML_BASED_CUDA_CHECK','1')
|
| 5 |
+
os.putenv('TORCH_LINALG_PREFER_CUSOLVER','1')
|
| 6 |
+
alloc_conf_parts = [
|
| 7 |
+
'expandable_segments:True',
|
| 8 |
+
'pinned_use_background_threads:True' # Specific to pinned memory.
|
| 9 |
+
]
|
| 10 |
+
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = ','.join(alloc_conf_parts)
|
| 11 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 12 |
+
os.putenv('HF_HUB_ENABLE_HF_TRANSFER','1')
|
| 13 |
|
| 14 |
import gradio as gr
|
| 15 |
import numpy as np
|
|
|
|
| 41 |
torch.backends.cudnn.allow_tf32 = False
|
| 42 |
torch.backends.cudnn.deterministic = False
|
| 43 |
torch.backends.cudnn.benchmark = False
|
| 44 |
+
torch.backends.cuda.preferred_blas_library="cublas"
|
| 45 |
+
torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 46 |
torch.set_float32_matmul_precision("highest")
|
| 47 |
|
| 48 |
hftoken = os.getenv("HF_AUTH_TOKEN")
|