Text Generation
Transformers
PyTorch
Chinese
English
batgpt
feature-extraction
BatGPT
MLP
custom_code
Run this model with HF Jobs
Run MYTH-Lab/BatGPT-15B-sirius on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/MYTH-Lab/BatGPT-15B-sirius. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MYTH-Lab/BatGPT-15B-sirius on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/MYTH-Lab/BatGPT-15B-sirius. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/MYTH-Lab/BatGPT-15B-sirius. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use MYTH-Lab/BatGPT-15B-sirius with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MYTH-Lab/BatGPT-15B-sirius with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MYTH-Lab/BatGPT-15B-sirius", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MYTH-Lab/BatGPT-15B-sirius", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MYTH-Lab/BatGPT-15B-sirius with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MYTH-Lab/BatGPT-15B-sirius" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MYTH-Lab/BatGPT-15B-sirius", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MYTH-Lab/BatGPT-15B-sirius
- SGLang
How to use MYTH-Lab/BatGPT-15B-sirius 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 "MYTH-Lab/BatGPT-15B-sirius" \ --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": "MYTH-Lab/BatGPT-15B-sirius", "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 "MYTH-Lab/BatGPT-15B-sirius" \ --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": "MYTH-Lab/BatGPT-15B-sirius", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MYTH-Lab/BatGPT-15B-sirius with Docker Model Runner:
docker model run hf.co/MYTH-Lab/BatGPT-15B-sirius
Charlie commited on
Commit ·
af2f908
1
Parent(s): fbed214
Update Readme
Browse filesFiles changed (2)
- README.md+1-2
- modeling_batgpt.py-50
8 unmodified lines9101112131415168 unmodified linesinference: false---# BatGPT-15B-sirius<!-- Provide a quick summary of what the model is/does. -->## 介绍 (Introduction)8 unmodified lines91011121314158 unmodified linesinference: false---# BatGPT-15B-siriusBidirectional Autoregressive Talker from Generative Pre-trained Transformer## 介绍 (Introduction)
939 unmodified lines940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995939 unmodified linesfor layer_past in past)def quantize(self, bits: int):try:# from .quantizer import QLinearfrom quantizer import QLinearexcept ImportError:raise ImportError(f"Needs QLinear to run quantize.")for layer in self.model.encoder.layers:layer.self_attention.query_proj = QLinear(bits=bits,weight=layer.self_attention.query_proj.weight,bias = layer.self_attention.query_proj.bias if self.config.qkv_bias else None,)layer.self_attention.key_proj = QLinear(bits=bits,weight=layer.self_attention.key_proj.weight,bias = layer.self_attention.key_proj.bias if self.config.qkv_bias else None,)layer.self_attention.value_proj = QLinear(bits=bits,weight=layer.self_attention.value_proj.weight,bias = layer.self_attention.value_proj.bias if self.config.qkv_bias else None,)layer.self_attention.dense = QLinear(bits=bits,weight=layer.self_attention.dense.weight,bias = None,)layer.mlp.dense_h_to_4h = QLinear(bits=bits,weight=layer.mlp.dense_h_to_4h.weight,bias = None,)layer.mlp.dense_4h_to_h = QLinear(bits=bits,weight=layer.mlp.dense_4h_to_h.weight,bias = None,)if self.config.mlp_activation == "silu":layer.mlp.gate_proj = QLinear(bits=bits,weight=layer.mlp.gate_proj.weight,bias = None,)return selfdef process_response(self, response):response = response.strip()return response939 unmodified lines940941942943944945939 unmodified linesfor layer_past in past)def process_response(self, response):response = response.strip()return response
README.md+1-2
modeling_batgpt.py-50