File size: 2,570 Bytes
6c9b7fc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | # Deployment Guide: Syncing GitHub to Hugging Face Space
## Quick Setup (Choose ONE method)
### Method 1: Direct Push to Hugging Face (Recommended)
1. **Get your Hugging Face Token:**
- Go to https://huggingface.co/settings/tokens
- Click "New token" β Create a **Write** token
- Copy the token
2. **Login to Hugging Face CLI:**
```bash
huggingface-cli login
```
- Paste your token when prompted
3. **Clone the Hugging Face Space repository:**
```bash
cd d:\Documents\SFU\PHYS385_Quantum2\CodeProjects
git clone https://huggingface.co/spaces/AhiBucket/Hand-wave huggingface-hand-wave
```
4. **Copy files from GitHub repo to HF Space:**
```bash
cd huggingface-hand-wave
Copy-Item -Path "..\Hand-wave\app.py" -Destination "." -Force
Copy-Item -Path "..\Hand-wave\functions.py" -Destination "." -Force
Copy-Item -Path "..\Hand-wave\requirements.txt" -Destination "." -Force
Copy-Item -Path "..\Hand-wave\README.md" -Destination "." -Force
```
5. **Commit and push to Hugging Face:**
```bash
git add .
git commit -m "Update: Fixed Plotly compatibility for wavefunction display"
git push
```
---
### Method 2: GitHub Integration (Via Web UI)
1. **Go to your Space Settings:**
- Navigate to https://huggingface.co/spaces/AhiBucket/Hand-wave
- Click **"Settings"** (top right, near your profile)
2. **Connect GitHub Repository:**
- Scroll to **"Repository"** section
- Click **"Connect to GitHub"**
- Select repository: `Ahilan-Bucket/Hand-wave`
- Choose branch: `main`
- Click **"Save"**
3. **Enable Auto-sync:**
- Toggle **"Automatically rebuild on push"**
- This will sync your GitHub repo to HF Space automatically
---
## What's Been Done Already β
1. β
Created new GitHub repository: `Hand-wave`
2. β
Copied all necessary files from `psi_solve2`
3. β
Fixed Plotly compatibility issues for Hugging Face
4. β
Pushed code to GitHub: https://github.com/Ahilan-Bucket/Hand-wave
## What's Next π
- Choose Method 1 or Method 2 above to sync to Hugging Face
- Once synced, the wavefunctions should display correctly!
- Test the deployment at: https://huggingface.co/spaces/AhiBucket/Hand-wave
## Troubleshooting
**If the app doesn't start:**
- Check the build logs in the Hugging Face Space
- Verify `requirements.txt` has all dependencies
- Make sure `app.py` is in the root directory
**If wavefunctions still don't show:**
- The fixes we made should resolve this
- Check browser console for JavaScript errors
- Verify Plotly version compatibility
|