Text Generation
Transformers
PyTorch
Safetensors
English
Chinese
qwen2
axolotl
Generated from Trainer
conversational
text-generation-inference
Instructions to use CoolSpring/Qwen2-0.5B-Abyme with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CoolSpring/Qwen2-0.5B-Abyme with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CoolSpring/Qwen2-0.5B-Abyme") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CoolSpring/Qwen2-0.5B-Abyme") model = AutoModelForCausalLM.from_pretrained("CoolSpring/Qwen2-0.5B-Abyme", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CoolSpring/Qwen2-0.5B-Abyme with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CoolSpring/Qwen2-0.5B-Abyme" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CoolSpring/Qwen2-0.5B-Abyme", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CoolSpring/Qwen2-0.5B-Abyme
- SGLang
How to use CoolSpring/Qwen2-0.5B-Abyme 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 "CoolSpring/Qwen2-0.5B-Abyme" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CoolSpring/Qwen2-0.5B-Abyme", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "CoolSpring/Qwen2-0.5B-Abyme" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CoolSpring/Qwen2-0.5B-Abyme", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CoolSpring/Qwen2-0.5B-Abyme with Docker Model Runner:
docker model run hf.co/CoolSpring/Qwen2-0.5B-Abyme
| license: apache-2.0 | |
| base_model: Qwen/Qwen2-0.5B | |
| tags: | |
| - axolotl | |
| - generated_from_trainer | |
| model-index: | |
| - name: Qwen2-0.5B-Abyme | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| [<img src="https://raw.githubusercontent.com/axolotl-ai-cloud/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/axolotl-ai-cloud/axolotl) | |
| <details><summary>See axolotl config</summary> | |
| axolotl version: `0.4.1` | |
| ```yaml | |
| adapter: null | |
| base_model: Qwen/Qwen2-0.5B | |
| bf16: auto | |
| chat_template: chatml | |
| dataset_prepared_path: ./data/last_run_prepared | |
| datasets: | |
| - path: Magpie-Align/Magpie-Qwen2-Pro-300K-Filtered | |
| type: sharegpt | |
| deepspeed: null | |
| early_stopping_patience: null | |
| eval_sample_packing: true | |
| evals_per_epoch: 4 | |
| flash_attention: true | |
| fp16: null | |
| fsdp: null | |
| gradient_accumulation_steps: 4 | |
| gradient_checkpointing: true | |
| gradient_checkpointing_kwargs: | |
| use_reentrant: false | |
| group_by_length: false | |
| hf_use_auth_token: true | |
| hub_model_id: CoolSpring/Qwen2-0.5B-Abyme | |
| learning_rate: 2e-5 | |
| load_in_4bit: false | |
| load_in_8bit: false | |
| local_rank: null | |
| logging_steps: 1 | |
| lr_scheduler: cosine | |
| micro_batch_size: 4 | |
| num_epochs: 1 | |
| optimizer: adamw_torch | |
| output_dir: ./outputs/out | |
| pad_to_sequence_len: true | |
| resize_token_embeddings_to_32x: true | |
| resume_from_checkpoint: null | |
| sample_packing: true | |
| saves_per_epoch: 1 | |
| sequence_len: 4096 | |
| tf32: true | |
| tokens: | |
| - <|im_start|> | |
| - <|im_end|> | |
| train_on_inputs: false | |
| val_set_size: 0.05 | |
| wandb_entity: null | |
| wandb_log_model: null | |
| wandb_name: Qwen2-0.5B-Abyme | |
| wandb_project: Qwen2-0.5B-Magpie-Qwen2-Pro-300K-Filtered | |
| wandb_watch: null | |
| warmup_steps: 100 | |
| weight_decay: null | |
| xformers_attention: null | |
| ``` | |
| </details><br> | |
| [<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="200" height="32"/>](https://wandb.ai/coolspring-none/Qwen2-0.5B-Magpie-Qwen2-Pro-300K-Filtered/runs/qcne24ii) | |
| # Qwen2-0.5B-Abyme | |
| This model is a fine-tuned version of [Qwen/Qwen2-0.5B](https://huggingface.co/Qwen/Qwen2-0.5B) on the None dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.8229 | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 2e-05 | |
| - train_batch_size: 4 | |
| - eval_batch_size: 4 | |
| - seed: 42 | |
| - gradient_accumulation_steps: 4 | |
| - total_train_batch_size: 16 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: cosine | |
| - lr_scheduler_warmup_steps: 100 | |
| - num_epochs: 1 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:------:|:----:|:---------------:| | |
| | 0.9947 | 0.0004 | 1 | 0.9683 | | |
| | 0.8385 | 0.2501 | 597 | 0.8338 | | |
| | 0.7636 | 0.5002 | 1194 | 0.8249 | | |
| | 0.8124 | 0.7502 | 1791 | 0.8229 | | |
| ### Framework versions | |
| - Transformers 4.42.3 | |
| - Pytorch 2.3.1+cu121 | |
| - Datasets 2.19.1 | |
| - Tokenizers 0.19.1 | |