Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,9 @@ import tempfile
|
|
| 8 |
HF_BUCKET = "hf://buckets/Krixter/storage"
|
| 9 |
|
| 10 |
def get_fs():
|
| 11 |
-
"""Initialize the Hugging Face File System
|
| 12 |
token = os.environ.get("HF_TOKEN")
|
| 13 |
-
|
| 14 |
-
raise ValueError("⚠️ HF_TOKEN secret is missing. Please add it to your Space settings.")
|
| 15 |
return HfFileSystem(token=token)
|
| 16 |
|
| 17 |
def format_size(size_bytes):
|
|
|
|
| 8 |
HF_BUCKET = "hf://buckets/Krixter/storage"
|
| 9 |
|
| 10 |
def get_fs():
|
| 11 |
+
"""Initialize the Hugging Face File System. Uses a token if available, otherwise runs anonymously."""
|
| 12 |
token = os.environ.get("HF_TOKEN")
|
| 13 |
+
# If there's no token, HfFileSystem will just run in public/anonymous mode
|
|
|
|
| 14 |
return HfFileSystem(token=token)
|
| 15 |
|
| 16 |
def format_size(size_bytes):
|