Update app.py
Browse files
app.py
CHANGED
@@ -19,18 +19,12 @@ GCP_LOCATION = os.environ.get("GCP_LOCATION")
|
|
19 |
|
20 |
|
21 |
# Set up HF_TOKEN for Hugging Face Hub authentication
|
22 |
-
|
23 |
-
if
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
try:
|
29 |
-
login(token=HF_TOKEN)
|
30 |
-
except Exception as e:
|
31 |
-
raise EnvironmentError(
|
32 |
-
f"Failed to authenticate with HF_TOKEN. Ensure the token has read access."
|
33 |
-
)
|
34 |
|
35 |
creds_json_str = os.environ.get("GOOGLE_APPLICATION_CREDENTIALS_JSON")
|
36 |
|
|
|
19 |
|
20 |
|
21 |
# Set up HF_TOKEN for Hugging Face Hub authentication
|
22 |
+
hf_token = os.environ.get("HF_TOKEN")
|
23 |
+
if hf_token:
|
24 |
+
print("Hugging Face token found. Logging in.")
|
25 |
+
login(token=hf_token)
|
26 |
+
else:
|
27 |
+
print("WARNING: Hugging Face token ('HF_TOKEN') not found. Hub-related features may be disabled.")
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
creds_json_str = os.environ.get("GOOGLE_APPLICATION_CREDENTIALS_JSON")
|
30 |
|