Spaces:
Sleeping
Sleeping
feat: using space secret
Browse files- src/main.py +3 -1
src/main.py
CHANGED
|
@@ -100,7 +100,9 @@ def push_observation(tab_log:DeltaGenerator=None):
|
|
| 100 |
tab_log.info(f"Uploading observation: {metadata_str}")
|
| 101 |
|
| 102 |
# get huggingface api
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
|
| 105 |
f = tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False)
|
| 106 |
f.write(metadata_str)
|
|
|
|
| 100 |
tab_log.info(f"Uploading observation: {metadata_str}")
|
| 101 |
|
| 102 |
# get huggingface api
|
| 103 |
+
import os
|
| 104 |
+
token = os.getenv("HF_TOKEN")
|
| 105 |
+
api = HfApi(token=token)
|
| 106 |
|
| 107 |
f = tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False)
|
| 108 |
f.write(metadata_str)
|