Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,6 +23,16 @@ from huggingface_hub import login
|
|
| 23 |
# Check if the token is already set in the environment variables
|
| 24 |
hf_token = os.environ(["HF_TOKEN"])
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
# Set up logging
|
|
|
|
| 23 |
# Check if the token is already set in the environment variables
|
| 24 |
hf_token = os.environ(["HF_TOKEN"])
|
| 25 |
|
| 26 |
+
if hf_token is None:
|
| 27 |
+
# If the token is not set, prompt for it (this should be done securely)
|
| 28 |
+
print("Please set your Hugging Face token in the environment variables.")
|
| 29 |
+
else:
|
| 30 |
+
# Login using the token
|
| 31 |
+
login(token=hf_token)
|
| 32 |
+
|
| 33 |
+
# Your application logic goes here
|
| 34 |
+
print("Logged in successfully to Hugging Face Hub!")
|
| 35 |
+
|
| 36 |
|
| 37 |
|
| 38 |
# Set up logging
|