Text Generation
Transformers
PyTorch
English
experimental
research
bit-level
transformer
reversible
safety
telemetry
language-modeling
Instructions to use WCNegentropy/BitTransformerLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use WCNegentropy/BitTransformerLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="WCNegentropy/BitTransformerLM")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("WCNegentropy/BitTransformerLM", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use WCNegentropy/BitTransformerLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "WCNegentropy/BitTransformerLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/WCNegentropy/BitTransformerLM
- SGLang
How to use WCNegentropy/BitTransformerLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "WCNegentropy/BitTransformerLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "WCNegentropy/BitTransformerLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "WCNegentropy/BitTransformerLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use WCNegentropy/BitTransformerLM with Docker Model Runner:
docker model run hf.co/WCNegentropy/BitTransformerLM
| # BitTransformerLM Scripts | |
| This directory contains organized scripts for BitTransformerLM development, training, and evaluation. | |
| ## Directory Structure | |
| ``` | |
| scripts/ | |
| βββ training/ # Training scripts and experiments | |
| βββ examples/ # Example usage and demonstrations | |
| βββ testing/ # Test scripts and validation | |
| βββ benchmarks/ # Performance benchmarks | |
| βββ tools/ # Utility scripts and data processing | |
| ``` | |
| ## Training Scripts (`training/`) | |
| - **basic_training.py** - Simple training setup for small models | |
| - **breakthrough_training.py** - Advanced training with breakthrough techniques | |
| - **cpu_edge_training.py** - CPU-optimized training for edge deployment | |
| - **final_breakthrough_training.py** - Production training pipeline | |
| - **full_attention_training.py** - Full attention mechanism training | |
| - **full_bits_train.py** - Complete bit-level training | |
| - **production_training.py** - Production-ready training script | |
| - **progressive_scaleup.py** - Progressive model scaling | |
| - **quick_training_run.py** - Fast training for development | |
| ## Example Scripts (`examples/`) | |
| - **example.py** - Basic usage example | |
| - **better_sampling.py** - Advanced sampling techniques | |
| - **debug_generation.py** - Generation debugging utilities | |
| - **raw_generation.py** - Low-level generation examples | |
| - **simple_test.py** - Simple model testing | |
| ## Testing Scripts (`testing/`) | |
| - **code_test.py** - Code functionality testing | |
| - **diffusion_tests.py** - Diffusion mode testing | |
| - **enhanced_generation_test.py** - Advanced generation testing | |
| - **full_attention_inference_test.py** - Attention mechanism tests | |
| - **test_conversation.py** - Conversational AI testing | |
| ## Benchmark Scripts (`benchmarks/`) | |
| - **wikitext_benchmark.py** - WikiText dataset benchmarking | |
| - **wikitext_schedule.py** - WikiText training schedule | |
| ## Utility Tools (`tools/`) | |
| - **build_full_bits.py** - Bit sequence construction | |
| - **create_dataset.py** - Dataset creation utilities | |
| - **enhanced_checkpoint_system.py** - Advanced checkpointing | |
| - **integration_flow.py** - Integration workflow | |
| - **integration_schedule.py** - Integration scheduling | |
| - **sync_to_hf.py** - HuggingFace synchronization | |
| - **unified_workflow.py** - Unified training workflow | |
| - **watcher.py** - File system monitoring | |
| ## Usage | |
| All scripts support the standardized CLI interface provided by `bit_transformer.cli_standards`. Use `--help` with any script to see available options. | |
| ### Quick Start | |
| ```bash | |
| # Train a small model | |
| python scripts/training/basic_training.py --model-size small --epochs 5 | |
| # Run a simple test | |
| python scripts/examples/simple_test.py --d-model 64 | |
| # Benchmark on WikiText | |
| python scripts/benchmarks/wikitext_benchmark.py --dataset-name wikitext-2 | |
| ``` | |
| ### Environment Variables | |
| Scripts support configuration via environment variables with `BT_` prefix: | |
| ```bash | |
| export BT_D_MODEL=128 | |
| export BT_NUM_LAYERS=4 | |
| export BT_BATCH_SIZE=16 | |
| python scripts/training/basic_training.py | |
| ``` | |
| ## Development Guidelines | |
| - All scripts should use `bit_transformer.cli_standards` for argument parsing | |
| - Include proper logging and error handling | |
| - Support both CPU and GPU execution | |
| - Follow the naming conventions established in existing scripts | |
| - Add documentation for any new hyperparameters or features |