Views
No views yet
| File | Where it comes from |
|---|---|
app.py | this repo |
requirements.txt | this repo |
README.md | this repo (has the HF Space frontmatter — keep it) |
export_for_space.py | this repo (optional; documentation only) |
physiolead_model.pt | run export_for_space.py in Kaggle, download from Output tab |
physiolead_examples.npz | same Kaggle run, same Output tab |
model, ROOT, meta exist). They save to /kaggle/working/ — download
them from Kaggle's right-hand Output panel.physiolead-ecg, SDK Gradio,
license MIT — or from the CLI:1pip install huggingface_hub
2huggingface-cli login # paste your write token
3huggingface-cli repo create physiolead-ecg --type space --space_sdk gradioYOUR_USERNAME below with your HF username throughout.1# clone the (empty) Space repo
2git clone https://huggingface.co/spaces/YOUR_USERNAME/physiolead-ecg
3cd physiolead-ecg
4
5# copy your 6 files into this folder (adjust paths to where you downloaded them)
6cp /path/to/app.py .
7cp /path/to/requirements.txt .
8cp /path/to/README.md .
9cp /path/to/export_for_space.py .
10cp /path/to/physiolead_model.pt .
11cp /path/to/physiolead_examples.npz .
12
13# stage and commit
14git add app.py requirements.txt README.md export_for_space.py \
15 physiolead_model.pt physiolead_examples.npz
16git commit -m "PhysioLead reduced-lead ECG reconstruction demo"
17
18# push (username = your HF username, password = your WRITE token)
19git pushphysiolead_model.pt is small (a few MB) and pushes fine over plain git. But HF
Spaces track *.pt with git-lfs by default. If the push complains about file
size or LFS:1git lfs install
2git lfs track "*.pt" "*.npz"
3git add .gitattributes
4git add physiolead_model.pt physiolead_examples.npz
5git commit -m "track model + examples with LFS"
6git pushhttps://huggingface.co/spaces/YOUR_USERNAME/physiolead-ecg.load_state_dict error in the logs → the model classes in app.py don't
match your trained model's dimensions. Fix the class definitions in app.py to
match, commit, push again.physiolead_examples.npz has duplicate
beats; re-run the (fixed) export_for_space.py in Kaggle and re-push just that
file.app.py):1# in the physiolead-ecg folder
2git add app.py
3git commit -m "update app"
4git pushAuthentication failed — use your write token as the password, not your
account password. Username is your HF username.remote: Password authentication ... deprecated — same fix: token, not
password.requirements.txt, a code error shows a traceback there.README.md frontmatter must say sdk: gradio; if you
created the Space as Static or Streamlit, delete and recreate as Gradio.