Skip to content

Instantly share code, notes, and snippets.

@wesslen
Created June 26, 2023 23:06
Show Gist options
  • Select an option

  • Save wesslen/909039d07fb6ef6a1913b19ba5512af2 to your computer and use it in GitHub Desktop.

Select an option

Save wesslen/909039d07fb6ef6a1913b19ba5512af2 to your computer and use it in GitHub Desktop.
Create new Prodigy instance on HF Space
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