Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -848,7 +848,7 @@ class ProfileManager:
|
|
848 |
json.dump(data, f, indent=2, ensure_ascii=False)
|
849 |
|
850 |
# Upload to HF Hub if token is available
|
851 |
-
if HF_TOKEN and hf_api:
|
852 |
try:
|
853 |
hf_api.upload_file(
|
854 |
path_or_fileobj=filepath,
|
@@ -887,7 +887,7 @@ class ProfileManager:
|
|
887 |
|
888 |
if not profile_file.exists():
|
889 |
# Try loading from HF Hub
|
890 |
-
if HF_TOKEN and hf_api:
|
891 |
try:
|
892 |
hf_api.download_file(
|
893 |
path_in_repo=f"profiles/{profile_file.name}",
|
@@ -1396,7 +1396,6 @@ def create_interface():
|
|
1396 |
gr.update(elem_classes="completed-tab"),
|
1397 |
gr.update(interactive=True),
|
1398 |
gr.update(visible=False)
|
1399 |
-
)
|
1400 |
except Exception as e:
|
1401 |
logging.error(f"Upload error: {str(e)}")
|
1402 |
return (
|
|
|
848 |
json.dump(data, f, indent=2, ensure_ascii=False)
|
849 |
|
850 |
# Upload to HF Hub if token is available
|
851 |
+
if HF_TOKEN and 'hf_api' in globals():
|
852 |
try:
|
853 |
hf_api.upload_file(
|
854 |
path_or_fileobj=filepath,
|
|
|
887 |
|
888 |
if not profile_file.exists():
|
889 |
# Try loading from HF Hub
|
890 |
+
if HF_TOKEN and 'hf_api' in globals():
|
891 |
try:
|
892 |
hf_api.download_file(
|
893 |
path_in_repo=f"profiles/{profile_file.name}",
|
|
|
1396 |
gr.update(elem_classes="completed-tab"),
|
1397 |
gr.update(interactive=True),
|
1398 |
gr.update(visible=False)
|
|
|
1399 |
except Exception as e:
|
1400 |
logging.error(f"Upload error: {str(e)}")
|
1401 |
return (
|