Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
|
|
| 1 |
import subprocess
|
| 2 |
subprocess.run(['sh', './spaces.sh'])
|
|
|
|
| 3 |
|
| 4 |
import os
|
| 5 |
|
| 6 |
os.environ['PYTORCH_NVML_BASED_CUDA_CHECK'] = '1'
|
| 7 |
os.environ['TORCH_LINALG_PREFER_CUSOLVER'] = '1'
|
| 8 |
-
os.environ['
|
| 9 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 10 |
os.environ['HF_HUB_ENABLE_HF_TRANSFER'] = '1'
|
| 11 |
|
| 12 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
import gradio as gr
|
| 14 |
import numpy as np
|
| 15 |
import random
|
|
|
|
| 1 |
+
|
| 2 |
import subprocess
|
| 3 |
subprocess.run(['sh', './spaces.sh'])
|
| 4 |
+
import spaces
|
| 5 |
|
| 6 |
import os
|
| 7 |
|
| 8 |
os.environ['PYTORCH_NVML_BASED_CUDA_CHECK'] = '1'
|
| 9 |
os.environ['TORCH_LINALG_PREFER_CUSOLVER'] = '1'
|
| 10 |
+
os.environ['PYTORCH_ALLOC_CONF'] = 'expandable_segments:True,pinned_use_background_threads:True'
|
| 11 |
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
| 12 |
os.environ['HF_HUB_ENABLE_HF_TRANSFER'] = '1'
|
| 13 |
|
| 14 |
+
import torch
|
| 15 |
+
|
| 16 |
+
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
| 17 |
+
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
| 18 |
+
torch.backends.fp32_precision = "ieee"
|
| 19 |
+
torch.backends.cuda.matmul.fp32_precision = "ieee"
|
| 20 |
+
torch.backends.cudnn.fp32_precision = "ieee"
|
| 21 |
+
torch.backends.cudnn.conv.fp32_precision = "ieee"
|
| 22 |
+
torch.backends.cudnn.rnn.fp32_precision = "ieee"
|
| 23 |
+
torch.backends.cudnn.deterministic = False
|
| 24 |
+
torch.backends.cudnn.benchmark = False
|
| 25 |
+
torch.backends.cuda.preferred_blas_library="cublas"
|
| 26 |
+
torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 27 |
+
torch.set_float32_matmul_precision("highest")
|
| 28 |
+
|
| 29 |
import gradio as gr
|
| 30 |
import numpy as np
|
| 31 |
import random
|