Step-by-Step Publishing Guide for chest2vec_0.6b_chest
Step 1: Prepare the Repository
1.1 Initialize Git (if not already done)
cd /opt/project/chest2vec/export_chest2vec_0.6b_chest
git init
1.2 Add all files
git add .
1.3 Create initial commit
git commit -m "Initial release: chest2vec_0.6b_chest"
Step 2: Create Repository on Hugging Face Hub
- Go to https://huggingface.co/new
- Fill in:
- Repository name:
chest2vec_0.6b_chest - Owner: Your username or organization
- Type: Model
- Visibility: Public or Private (your choice)
- Repository name:
- Click "Create repository"
Step 3: Install Hugging Face Hub CLI
pip install huggingface_hub
Step 4: Login to Hugging Face
huggingface-cli login
Enter your Hugging Face token when prompted (get it from https://huggingface.co/settings/tokens)
Step 5: Push to Hugging Face Hub
Option A: Using Git (Recommended)
cd /opt/project/chest2vec/export_chest2vec_0.6b_chest
git remote add origin https://huggingface.co/YOUR_USERNAME/chest2vec_0.6b_chest
git push -u origin main
Option B: Using HF Hub CLI
cd /opt/project/chest2vec/export_chest2vec_0.6b_chest
huggingface-cli upload YOUR_USERNAME/chest2vec_0.6b_chest . --repo-type model
Step 6: Verify Upload
Visit: https://huggingface.co/YOUR_USERNAME/chest2vec_0.6b_chest
Make sure all files are present:
- ✅ README.md
- ✅ chest2vec.py
- ✅ chest2vec_config.json
- ✅ section_pooler.pt
- ✅ section_pooler_config.json
- ✅ contrastive/ directory
- ✅ All other files
Step 7: Test Loading (Optional but Recommended)
from chest2vec import Chest2Vec
# Test loading from HF Hub
m = Chest2Vec.from_pretrained("YOUR_USERNAME/chest2vec_0.6b_chest", device="cuda:0")
print("✅ Model loaded successfully!")
Alternative: Publish to PyPI (Optional)
If you also want to publish the Python package to PyPI:
Prerequisites
pip install build twine
Build Package
cd /opt/project/chest2vec/export_chest2vec_0.6b_chest
python3 -m build
Upload to TestPyPI (Test First)
twine upload --repository testpypi dist/*
# Username: __token__
# Password: your PyPI API token
Upload to PyPI
twine upload dist/*
# Username: __token__
# Password: your PyPI API token
Quick Command Summary
# 1. Navigate to export directory
cd /opt/project/chest2vec/export_chest2vec_0.6b_chest
# 2. Initialize git and commit
git init
git add .
git commit -m "Initial release: chest2vec_0.6b_chest"
# 3. Login to HF
huggingface-cli login
# 4. Push to HF Hub (replace YOUR_USERNAME)
git remote add origin https://huggingface.co/YOUR_USERNAME/chest2vec_0.6b_chest
git push -u origin main