Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,22 @@ os.environ["XDG_CONFIG_HOME"] = "/tmp"
|
|
15 |
|
16 |
import streamlit as st
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
import sys
|
19 |
import os
|
20 |
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
|
|
|
15 |
|
16 |
import streamlit as st
|
17 |
|
18 |
+
|
19 |
+
hf_token = os.getenv("HF_token") # Match the exact name you set in the Secrets tab
|
20 |
+
|
21 |
+
# Example usage with requests
|
22 |
+
headers = {
|
23 |
+
"Authorization": f"Bearer {hf_token}"
|
24 |
+
}
|
25 |
+
|
26 |
+
# Example: Access a private file or API on Hugging Face
|
27 |
+
import requests
|
28 |
+
response = requests.get("https://huggingface.co/api/whoami-v2", headers=headers)
|
29 |
+
|
30 |
+
print(response.json())
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
import sys
|
35 |
import os
|
36 |
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
|