Dickson commited on
Commit ·
44440dd
1
Parent(s): 8a330e9
add apple support
Browse files
app.py
CHANGED
|
@@ -27,7 +27,23 @@ subprocess.run(['wget', '-N', training_script_url])
|
|
| 27 |
orchestrator_script_url = "https://huggingface.co/datasets/multimodalart/lora-ease-helper/raw/main/script.py"
|
| 28 |
subprocess.run(['wget', '-N', orchestrator_script_url])
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
FACES_DATASET_PATH = snapshot_download(repo_id="multimodalart/faces-prior-preservation", repo_type="dataset")
|
| 33 |
#Delete .gitattributes to process things properly
|
|
|
|
| 27 |
orchestrator_script_url = "https://huggingface.co/datasets/multimodalart/lora-ease-helper/raw/main/script.py"
|
| 28 |
subprocess.run(['wget', '-N', orchestrator_script_url])
|
| 29 |
|
| 30 |
+
|
| 31 |
+
# device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
# Check for available GPU devices
|
| 35 |
+
if torch.cuda.is_available():
|
| 36 |
+
# If CUDA (NVIDIA GPU) is available, use it
|
| 37 |
+
device = torch.device("cuda")
|
| 38 |
+
elif hasattr(torch.backends, 'mps') and torch.backends.mps.is_available():
|
| 39 |
+
# If MPS (Apple Silicon GPU) is available, use it
|
| 40 |
+
device = torch.device("mps")
|
| 41 |
+
else:
|
| 42 |
+
# If no GPU is available, use CPU
|
| 43 |
+
device = torch.device("cpu")
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
|
| 48 |
FACES_DATASET_PATH = snapshot_download(repo_id="multimodalart/faces-prior-preservation", repo_type="dataset")
|
| 49 |
#Delete .gitattributes to process things properly
|