Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
4272a43
1
Parent(s):
fdc2c50
Add huggingface_hub login for gated model access
Browse files
app.py
CHANGED
|
@@ -14,7 +14,11 @@ import numpy as np
|
|
| 14 |
import spaces
|
| 15 |
import torch
|
| 16 |
import bpy
|
| 17 |
-
from huggingface_hub import snapshot_download
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
from PIL import Image
|
| 19 |
|
| 20 |
# Clone sam-3d-body repo if not exists
|
|
|
|
| 14 |
import spaces
|
| 15 |
import torch
|
| 16 |
import bpy
|
| 17 |
+
from huggingface_hub import snapshot_download, login
|
| 18 |
+
|
| 19 |
+
# Login with HF_TOKEN if available
|
| 20 |
+
if os.environ.get("HF_TOKEN"):
|
| 21 |
+
login(token=os.environ.get("HF_TOKEN"))
|
| 22 |
from PIL import Image
|
| 23 |
|
| 24 |
# Clone sam-3d-body repo if not exists
|