Text Generation
Transformers
Safetensors
qwen2
conversational
Eval Results (legacy)
Eval Results
text-generation-inference
Instructions to use FlameF0X/Qwen2-0.2B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlameF0X/Qwen2-0.2B-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FlameF0X/Qwen2-0.2B-it") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FlameF0X/Qwen2-0.2B-it") model = AutoModelForCausalLM.from_pretrained("FlameF0X/Qwen2-0.2B-it", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FlameF0X/Qwen2-0.2B-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FlameF0X/Qwen2-0.2B-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlameF0X/Qwen2-0.2B-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FlameF0X/Qwen2-0.2B-it
- SGLang
How to use FlameF0X/Qwen2-0.2B-it 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 "FlameF0X/Qwen2-0.2B-it" \ --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": "FlameF0X/Qwen2-0.2B-it", "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 "FlameF0X/Qwen2-0.2B-it" \ --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": "FlameF0X/Qwen2-0.2B-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FlameF0X/Qwen2-0.2B-it with Docker Model Runner:
docker model run hf.co/FlameF0X/Qwen2-0.2B-it
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 12.7424, | |
| "eval_steps": 500, | |
| "global_step": 2000, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.64, | |
| "grad_norm": 1.137086033821106, | |
| "learning_rate": 7.8416e-05, | |
| "loss": 6.348446655273437, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 1.2752, | |
| "grad_norm": 1.0378036499023438, | |
| "learning_rate": 7.6816e-05, | |
| "loss": 5.243690185546875, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.9152, | |
| "grad_norm": 0.9749150276184082, | |
| "learning_rate": 7.5216e-05, | |
| "loss": 4.91364013671875, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 2.5504, | |
| "grad_norm": 1.0230515003204346, | |
| "learning_rate": 7.361600000000001e-05, | |
| "loss": 4.62632568359375, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 3.1856, | |
| "grad_norm": 1.0212266445159912, | |
| "learning_rate": 7.201600000000001e-05, | |
| "loss": 4.4673223876953125, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 3.8256, | |
| "grad_norm": 1.1937462091445923, | |
| "learning_rate": 7.0416e-05, | |
| "loss": 4.2712399291992185, | |
| "step": 600 | |
| }, | |
| { | |
| "epoch": 4.4608, | |
| "grad_norm": 1.0884040594100952, | |
| "learning_rate": 6.8816e-05, | |
| "loss": 4.08659423828125, | |
| "step": 700 | |
| }, | |
| { | |
| "epoch": 5.096, | |
| "grad_norm": 1.1558771133422852, | |
| "learning_rate": 6.7216e-05, | |
| "loss": 3.9976934814453124, | |
| "step": 800 | |
| }, | |
| { | |
| "epoch": 5.736, | |
| "grad_norm": 1.2531368732452393, | |
| "learning_rate": 6.5616e-05, | |
| "loss": 3.7825747680664064, | |
| "step": 900 | |
| }, | |
| { | |
| "epoch": 6.3712, | |
| "grad_norm": 1.2680810689926147, | |
| "learning_rate": 6.4016e-05, | |
| "loss": 3.675318298339844, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 7.0064, | |
| "grad_norm": 1.3131264448165894, | |
| "learning_rate": 6.241600000000001e-05, | |
| "loss": 3.5979290771484376, | |
| "step": 1100 | |
| }, | |
| { | |
| "epoch": 7.6464, | |
| "grad_norm": 1.3655059337615967, | |
| "learning_rate": 6.0816e-05, | |
| "loss": 3.389007873535156, | |
| "step": 1200 | |
| }, | |
| { | |
| "epoch": 8.2816, | |
| "grad_norm": 1.4736028909683228, | |
| "learning_rate": 5.9216000000000004e-05, | |
| "loss": 3.2966958618164064, | |
| "step": 1300 | |
| }, | |
| { | |
| "epoch": 8.9216, | |
| "grad_norm": 1.445204496383667, | |
| "learning_rate": 5.7616e-05, | |
| "loss": 3.194217529296875, | |
| "step": 1400 | |
| }, | |
| { | |
| "epoch": 9.556799999999999, | |
| "grad_norm": 1.5872318744659424, | |
| "learning_rate": 5.601600000000001e-05, | |
| "loss": 3.0272833251953126, | |
| "step": 1500 | |
| }, | |
| { | |
| "epoch": 10.192, | |
| "grad_norm": 1.6559168100357056, | |
| "learning_rate": 5.441600000000001e-05, | |
| "loss": 2.9672927856445312, | |
| "step": 1600 | |
| }, | |
| { | |
| "epoch": 10.832, | |
| "grad_norm": 1.7011806964874268, | |
| "learning_rate": 5.2816000000000004e-05, | |
| "loss": 2.835576477050781, | |
| "step": 1700 | |
| }, | |
| { | |
| "epoch": 11.4672, | |
| "grad_norm": 1.7928874492645264, | |
| "learning_rate": 5.1216000000000006e-05, | |
| "loss": 2.706945495605469, | |
| "step": 1800 | |
| }, | |
| { | |
| "epoch": 12.1024, | |
| "grad_norm": 1.7846620082855225, | |
| "learning_rate": 4.9616e-05, | |
| "loss": 2.6535516357421876, | |
| "step": 1900 | |
| }, | |
| { | |
| "epoch": 12.7424, | |
| "grad_norm": 1.8277227878570557, | |
| "learning_rate": 4.8016e-05, | |
| "loss": 2.49991943359375, | |
| "step": 2000 | |
| } | |
| ], | |
| "logging_steps": 100, | |
| "max_steps": 5000, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 32, | |
| "save_steps": 1000, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 2.018085351456768e+16, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |