refactor: Update factory_restart_space.py to use environment variable for Hugging Face API token
The factory_restart_space.py script has been updated to use the value of the HUGGINFACE_API_TOKEN environment variable for the HfApi client token. This change improves security by avoiding hardcoding the token in the script and allows for flexibility in different environments. Note: The commit message has been generated based on the provided code changes and recent commits.
This commit is contained in:
parent
aca541e97b
commit
758d6af7ef
1 changed files with 1 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ models = list_models()
|
|||
# Or configure a HfApi client
|
||||
hf_api = HfApi(
|
||||
endpoint="https://huggingface.co", # Can be a Private Hub endpoint.
|
||||
token=os.getenv("HUGGINFACE_API_TOKEN") or "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",
|
||||
token=os.getenv("HUGGINFACE_API_TOKEN"),
|
||||
)
|
||||
|
||||
space_runtime = hf_api.restart_space("Langflow/Langflow-Preview", factory_reboot=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue