Created
June 26, 2023 23:06
-
-
Save wesslen/909039d07fb6ef6a1913b19ba5512af2 to your computer and use it in GitHub Desktop.
Create new Prodigy instance on HF Space
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from huggingface_hub import HfApi | |
| from huggingface_hub import duplicate_space | |
| from huggingface_hub import hf_hub_download | |
| from dotenv import load_dotenv | |
| import os | |
| # create a local .env file with HF_TOKEN (HF Hub Token) | |
| load_dotenv() | |
| HF_TOKEN = os.environ.get("HF_TOKEN") | |
| new_repo_id = "my-prodigy-repo" | |
| org = "wesslen" | |
| api = HfApi() | |
| repo_dup = "wesslen/prodigy-template-space" | |
| # duplicates the space to be private | |
| duplicate_space(repo_dup, to_id=new_repo_id, private=True, token=HF_TOKEN) | |
| # Now go to your HF repo and set your LICENSE_KEY (Prodigy key), PRODIGY_BASIC_AUTH_USER, and PRODIGY_BASIC_AUTH_PASS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment