π OS Launch: Clean documentation and refined licensing
Browse filesThis OS launch commit includes:
β
**Cleaned Documentation**
- Removed inflated claims and marketing language
- Added honest research status and limitations
- Created professional model card and validation reports
- Streamlined licensing to AGPLv3 + commercial contact
β
**Refined Codebase**
- Complete experimental bit-native transformer implementation
- 57 Python files with comprehensive research framework
- Safety telemetry and monitoring systems
- Distributed training and development tools
β
**Professional Standards**
- Empirical validation of all claims
- Clear experimental vs production distinctions
- Rigorous research methodology requirements
- Community contribution framework
Ready for serious research evaluation and academic investigation.
- sync_to_hf.py +220 -0
sync_to_hf.py
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Sync BitTransformerLM repository to HuggingFace Hub for OS launch.
|
| 4 |
+
Uploads all cleaned documentation and code with proper commit message.
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import os
|
| 8 |
+
import logging
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
from huggingface_hub import HfApi, login
|
| 11 |
+
from typing import Optional, List
|
| 12 |
+
|
| 13 |
+
# Setup logging
|
| 14 |
+
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 15 |
+
logger = logging.getLogger(__name__)
|
| 16 |
+
|
| 17 |
+
def sync_repository_to_hf(
|
| 18 |
+
repo_id: str = "WCNegentropy/BitTransformerLM",
|
| 19 |
+
token: Optional[str] = None,
|
| 20 |
+
commit_message: str = "π OS Launch: Clean documentation and refined licensing"
|
| 21 |
+
):
|
| 22 |
+
"""
|
| 23 |
+
Sync the entire cleaned BitTransformerLM repository to HuggingFace Hub.
|
| 24 |
+
|
| 25 |
+
Args:
|
| 26 |
+
repo_id: HuggingFace repository ID
|
| 27 |
+
token: HF token (defaults to HF_TOKEN environment variable)
|
| 28 |
+
commit_message: Commit message for the upload
|
| 29 |
+
"""
|
| 30 |
+
|
| 31 |
+
# Get token from environment if not provided
|
| 32 |
+
if token is None:
|
| 33 |
+
token = os.environ.get('HF_TOKEN')
|
| 34 |
+
if not token:
|
| 35 |
+
logger.error("HF_TOKEN environment variable not set and no token provided")
|
| 36 |
+
return False
|
| 37 |
+
|
| 38 |
+
try:
|
| 39 |
+
# Login to HuggingFace
|
| 40 |
+
login(token=token)
|
| 41 |
+
api = HfApi()
|
| 42 |
+
logger.info("Successfully authenticated with HuggingFace Hub")
|
| 43 |
+
|
| 44 |
+
# Get the repository root directory
|
| 45 |
+
repo_root = Path(__file__).parent
|
| 46 |
+
logger.info(f"Repository root: {repo_root}")
|
| 47 |
+
|
| 48 |
+
# Files and directories to upload (excluding unnecessary files)
|
| 49 |
+
include_patterns = [
|
| 50 |
+
# Core code
|
| 51 |
+
"bit_transformer/**/*.py",
|
| 52 |
+
"tests/**/*.py",
|
| 53 |
+
"*.py", # Root level Python files
|
| 54 |
+
|
| 55 |
+
# Documentation (cleaned)
|
| 56 |
+
"README.md",
|
| 57 |
+
"MODEL_CARD.md",
|
| 58 |
+
"RESEARCH_STATUS.md",
|
| 59 |
+
"EMPIRICAL_VALIDATION.md",
|
| 60 |
+
"OPEN_SOURCE_LAUNCH.md",
|
| 61 |
+
"AGENTS.md",
|
| 62 |
+
|
| 63 |
+
# Configuration
|
| 64 |
+
"requirements.txt",
|
| 65 |
+
"pyproject.toml",
|
| 66 |
+
"Dockerfile",
|
| 67 |
+
"start.sh",
|
| 68 |
+
|
| 69 |
+
# License files (cleaned)
|
| 70 |
+
"LICENSE/**/*.txt",
|
| 71 |
+
]
|
| 72 |
+
|
| 73 |
+
# Files to exclude
|
| 74 |
+
exclude_patterns = [
|
| 75 |
+
"__pycache__/**",
|
| 76 |
+
"*.pyc",
|
| 77 |
+
".git/**",
|
| 78 |
+
".pytest_cache/**",
|
| 79 |
+
"weights/**",
|
| 80 |
+
"checkpoints/**",
|
| 81 |
+
"*.log",
|
| 82 |
+
# Outdated documentation
|
| 83 |
+
"BitTransformerLM_full_assessment.md",
|
| 84 |
+
"FORENSIC_*.md",
|
| 85 |
+
"state_of_the_repo_audit.md",
|
| 86 |
+
# Old upload script
|
| 87 |
+
"upload_to_hf.py",
|
| 88 |
+
]
|
| 89 |
+
|
| 90 |
+
# Get all files to upload
|
| 91 |
+
files_to_upload = []
|
| 92 |
+
for pattern in include_patterns:
|
| 93 |
+
for file_path in repo_root.glob(pattern):
|
| 94 |
+
if file_path.is_file():
|
| 95 |
+
# Check if file should be excluded
|
| 96 |
+
relative_path = file_path.relative_to(repo_root)
|
| 97 |
+
should_exclude = any(
|
| 98 |
+
relative_path.match(exclude)
|
| 99 |
+
for exclude in exclude_patterns
|
| 100 |
+
)
|
| 101 |
+
if not should_exclude:
|
| 102 |
+
files_to_upload.append(file_path)
|
| 103 |
+
|
| 104 |
+
logger.info(f"Found {len(files_to_upload)} files to upload")
|
| 105 |
+
|
| 106 |
+
# Upload files in batches
|
| 107 |
+
uploaded_count = 0
|
| 108 |
+
for file_path in files_to_upload:
|
| 109 |
+
try:
|
| 110 |
+
relative_path = file_path.relative_to(repo_root)
|
| 111 |
+
logger.info(f"Uploading: {relative_path}")
|
| 112 |
+
|
| 113 |
+
api.upload_file(
|
| 114 |
+
path_or_fileobj=str(file_path),
|
| 115 |
+
path_in_repo=str(relative_path),
|
| 116 |
+
repo_id=repo_id,
|
| 117 |
+
repo_type="model",
|
| 118 |
+
commit_message=commit_message,
|
| 119 |
+
commit_description="""
|
| 120 |
+
This OS launch commit includes:
|
| 121 |
+
|
| 122 |
+
β
**Cleaned Documentation**
|
| 123 |
+
- Removed inflated claims and marketing language
|
| 124 |
+
- Added honest research status and limitations
|
| 125 |
+
- Created professional model card and validation reports
|
| 126 |
+
- Streamlined licensing to AGPLv3 + commercial contact
|
| 127 |
+
|
| 128 |
+
β
**Refined Codebase**
|
| 129 |
+
- Complete experimental bit-native transformer implementation
|
| 130 |
+
- 57 Python files with comprehensive research framework
|
| 131 |
+
- Safety telemetry and monitoring systems
|
| 132 |
+
- Distributed training and development tools
|
| 133 |
+
|
| 134 |
+
β
**Professional Standards**
|
| 135 |
+
- Empirical validation of all claims
|
| 136 |
+
- Clear experimental vs production distinctions
|
| 137 |
+
- Rigorous research methodology requirements
|
| 138 |
+
- Community contribution framework
|
| 139 |
+
|
| 140 |
+
Ready for serious research evaluation and academic investigation.
|
| 141 |
+
""".strip()
|
| 142 |
+
)
|
| 143 |
+
|
| 144 |
+
uploaded_count += 1
|
| 145 |
+
if uploaded_count % 10 == 0:
|
| 146 |
+
logger.info(f"Progress: {uploaded_count}/{len(files_to_upload)} files uploaded")
|
| 147 |
+
|
| 148 |
+
except Exception as e:
|
| 149 |
+
logger.warning(f"Failed to upload {relative_path}: {e}")
|
| 150 |
+
continue
|
| 151 |
+
|
| 152 |
+
logger.info(f"β
Successfully uploaded {uploaded_count}/{len(files_to_upload)} files")
|
| 153 |
+
logger.info(f"π Repository synced to: https://huggingface.co/{repo_id}")
|
| 154 |
+
|
| 155 |
+
return True
|
| 156 |
+
|
| 157 |
+
except Exception as e:
|
| 158 |
+
logger.error(f"β Failed to sync repository: {e}")
|
| 159 |
+
return False
|
| 160 |
+
|
| 161 |
+
def create_release_info():
|
| 162 |
+
"""Create a release information file for the OS launch."""
|
| 163 |
+
release_info = """# BitTransformerLM v0.1.0 - Experimental Research Release
|
| 164 |
+
|
| 165 |
+
**Release Date:** August 2025
|
| 166 |
+
**Status:** Open Source Research Implementation
|
| 167 |
+
**License:** AGPLv3 + Commercial Licensing Available
|
| 168 |
+
|
| 169 |
+
## What's Included
|
| 170 |
+
|
| 171 |
+
This release provides a complete experimental framework for bit-native language modeling research:
|
| 172 |
+
|
| 173 |
+
- **Core Architecture:** 57 Python files implementing bit-native transformer with reversible layers
|
| 174 |
+
- **Safety Systems:** Real-time K/C/S telemetry and monitoring
|
| 175 |
+
- **Research Tools:** Interactive dashboard, distributed training, comprehensive testing
|
| 176 |
+
- **Documentation:** Professional model card, research status, and validation reports
|
| 177 |
+
|
| 178 |
+
## Important Notes
|
| 179 |
+
|
| 180 |
+
β οΈ **Experimental Status:** This is research code requiring rigorous baseline validation
|
| 181 |
+
β οΈ **Not Production Ready:** Needs extensive evaluation vs standard transformers
|
| 182 |
+
β οΈ **Research Use Only:** Intended for academic investigation and experimentation
|
| 183 |
+
|
| 184 |
+
## Licensing
|
| 185 |
+
|
| 186 |
+
- **Open Source:** AGPLv3 for research and open source use
|
| 187 |
+
- **Commercial:** Contact [email protected] for commercial licensing
|
| 188 |
+
|
| 189 |
+
## Next Steps
|
| 190 |
+
|
| 191 |
+
The research community is invited to:
|
| 192 |
+
1. Conduct rigorous baseline comparisons vs standard transformers
|
| 193 |
+
2. Evaluate on established language modeling benchmarks
|
| 194 |
+
3. Validate (or refute) claimed memory efficiency benefits
|
| 195 |
+
4. Share findings openly to advance the field
|
| 196 |
+
|
| 197 |
+
**Research responsibly. Validate rigorously. Share openly.**
|
| 198 |
+
"""
|
| 199 |
+
|
| 200 |
+
release_file = Path(__file__).parent / "RELEASE_INFO.md"
|
| 201 |
+
with open(release_file, 'w') as f:
|
| 202 |
+
f.write(release_info)
|
| 203 |
+
|
| 204 |
+
logger.info("Created RELEASE_INFO.md")
|
| 205 |
+
return release_file
|
| 206 |
+
|
| 207 |
+
if __name__ == "__main__":
|
| 208 |
+
# Create release info file
|
| 209 |
+
create_release_info()
|
| 210 |
+
|
| 211 |
+
# Sync to HuggingFace
|
| 212 |
+
success = sync_repository_to_hf()
|
| 213 |
+
|
| 214 |
+
if success:
|
| 215 |
+
print("\nπ BitTransformerLM OS Launch Sync Complete!")
|
| 216 |
+
print("π Repository: https://huggingface.co/WCNegentropy/BitTransformerLM")
|
| 217 |
+
print("π§ Commercial inquiries: [email protected]")
|
| 218 |
+
print("\nReady for research community evaluation! π§ͺβ¨")
|
| 219 |
+
else:
|
| 220 |
+
print("\nβ Sync failed. Please check logs and try again.")
|