Spaces:
Sleeping
Sleeping
Download setup_git.sh from milwright/historical-ocr: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/spaces/milwright/historical-ocr/resolve/refs%2Fpr%2F1/setup_git.sh
- Command line
-
hf download hf://spaces/milwright/historical-ocr@refs/pr/1/setup_git.sh
-
curl -L -o setup_git.sh https://huggingface.co/spaces/milwright/historical-ocr/resolve/refs%2Fpr%2F1/setup_git.sh
1 kB
| # Setup git repository for Hugging Face Spaces | |
| # Check if HF_TOKEN environment variable is set | |
| if [ -z "$HF_TOKEN" ]; then | |
| echo "Error: HF_TOKEN environment variable is not set." | |
| echo "Please set it first with: export HF_TOKEN=your_hugging_face_token" | |
| exit 1 | |
| fi | |
| # Get your username | |
| echo "Enter your Hugging Face username:" | |
| read HF_USERNAME | |
| # Get the space name | |
| echo "Enter the name for your Hugging Face Space (e.g., historical-ocr):" | |
| read HF_SPACE | |
| # Prepare the files for deployment | |
| echo "Preparing files for deployment..." | |
| python3 prepare_for_hf.py | |
| # Initialize git | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| # Create the repository on Hugging Face | |
| echo "Creating and pushing to Hugging Face Space..." | |
| git remote add origin https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE | |
| huggingface-cli login --token $HF_TOKEN | |
| git push -u origin main | |
| echo "Deployment completed! Your app should be available at:" | |
| echo "https://huggingface.co/spaces/$HF_USERNAME/$HF_SPACE" |