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": 9.807384615384615, | |
| "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.24615384615384617, | |
| "grad_norm": 0.09971032291650772, | |
| "learning_rate": 7.921600000000001e-05, | |
| "loss": 3.8301455688476564, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.49230769230769234, | |
| "grad_norm": 0.0911579355597496, | |
| "learning_rate": 7.8416e-05, | |
| "loss": 3.0332159423828124, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.7384615384615385, | |
| "grad_norm": 0.10190442204475403, | |
| "learning_rate": 7.7616e-05, | |
| "loss": 2.7591339111328126, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.9846153846153847, | |
| "grad_norm": 0.09316737949848175, | |
| "learning_rate": 7.6816e-05, | |
| "loss": 2.617864074707031, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 1.2264615384615385, | |
| "grad_norm": 0.08559751510620117, | |
| "learning_rate": 7.601600000000001e-05, | |
| "loss": 2.3154002380371095, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 1.4726153846153847, | |
| "grad_norm": 0.0818333625793457, | |
| "learning_rate": 7.5216e-05, | |
| "loss": 2.227242126464844, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 1.7187692307692308, | |
| "grad_norm": 0.09082052856683731, | |
| "learning_rate": 7.441600000000001e-05, | |
| "loss": 2.1838539123535154, | |
| "step": 350 | |
| }, | |
| { | |
| "epoch": 1.964923076923077, | |
| "grad_norm": 0.08575436472892761, | |
| "learning_rate": 7.361600000000001e-05, | |
| "loss": 2.1341651916503905, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 2.206769230769231, | |
| "grad_norm": 0.08966775238513947, | |
| "learning_rate": 7.2816e-05, | |
| "loss": 1.9519345092773437, | |
| "step": 450 | |
| }, | |
| { | |
| "epoch": 2.452923076923077, | |
| "grad_norm": 0.08918383717536926, | |
| "learning_rate": 7.201600000000001e-05, | |
| "loss": 1.8568724060058595, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 2.699076923076923, | |
| "grad_norm": 0.09143362194299698, | |
| "learning_rate": 7.1216e-05, | |
| "loss": 1.8383006286621093, | |
| "step": 550 | |
| }, | |
| { | |
| "epoch": 2.9452307692307693, | |
| "grad_norm": 0.0969746857881546, | |
| "learning_rate": 7.0416e-05, | |
| "loss": 1.8297712707519531, | |
| "step": 600 | |
| }, | |
| { | |
| "epoch": 3.187076923076923, | |
| "grad_norm": 0.09824724495410919, | |
| "learning_rate": 6.9616e-05, | |
| "loss": 1.6545506286621094, | |
| "step": 650 | |
| }, | |
| { | |
| "epoch": 3.4332307692307693, | |
| "grad_norm": 0.08493440598249435, | |
| "learning_rate": 6.8816e-05, | |
| "loss": 1.6011067199707032, | |
| "step": 700 | |
| }, | |
| { | |
| "epoch": 3.6793846153846155, | |
| "grad_norm": 0.08676321804523468, | |
| "learning_rate": 6.801600000000001e-05, | |
| "loss": 1.5964797973632812, | |
| "step": 750 | |
| }, | |
| { | |
| "epoch": 3.9255384615384616, | |
| "grad_norm": 0.09471355378627777, | |
| "learning_rate": 6.7216e-05, | |
| "loss": 1.5877139282226562, | |
| "step": 800 | |
| }, | |
| { | |
| "epoch": 4.1673846153846155, | |
| "grad_norm": 0.08782424032688141, | |
| "learning_rate": 6.641600000000001e-05, | |
| "loss": 1.4405186462402344, | |
| "step": 850 | |
| }, | |
| { | |
| "epoch": 4.413538461538462, | |
| "grad_norm": 0.09666605293750763, | |
| "learning_rate": 6.5616e-05, | |
| "loss": 1.383701171875, | |
| "step": 900 | |
| }, | |
| { | |
| "epoch": 4.659692307692308, | |
| "grad_norm": 0.10380911082029343, | |
| "learning_rate": 6.481600000000001e-05, | |
| "loss": 1.375392608642578, | |
| "step": 950 | |
| }, | |
| { | |
| "epoch": 4.905846153846154, | |
| "grad_norm": 0.10152668505907059, | |
| "learning_rate": 6.4016e-05, | |
| "loss": 1.3678237915039062, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 5.147692307692307, | |
| "grad_norm": 0.102939173579216, | |
| "learning_rate": 6.321600000000001e-05, | |
| "loss": 1.257767333984375, | |
| "step": 1050 | |
| }, | |
| { | |
| "epoch": 5.3938461538461535, | |
| "grad_norm": 0.09689474105834961, | |
| "learning_rate": 6.241600000000001e-05, | |
| "loss": 1.179140625, | |
| "step": 1100 | |
| }, | |
| { | |
| "epoch": 5.64, | |
| "grad_norm": 0.09813547879457474, | |
| "learning_rate": 6.1616e-05, | |
| "loss": 1.1883023071289063, | |
| "step": 1150 | |
| }, | |
| { | |
| "epoch": 5.886153846153846, | |
| "grad_norm": 0.10634688287973404, | |
| "learning_rate": 6.0816e-05, | |
| "loss": 1.196829605102539, | |
| "step": 1200 | |
| }, | |
| { | |
| "epoch": 6.128, | |
| "grad_norm": 0.10477212816476822, | |
| "learning_rate": 6.0016e-05, | |
| "loss": 1.0858740234375, | |
| "step": 1250 | |
| }, | |
| { | |
| "epoch": 6.374153846153846, | |
| "grad_norm": 0.10455155372619629, | |
| "learning_rate": 5.9216000000000004e-05, | |
| "loss": 0.9896931457519531, | |
| "step": 1300 | |
| }, | |
| { | |
| "epoch": 6.6203076923076924, | |
| "grad_norm": 0.10506019741296768, | |
| "learning_rate": 5.8416000000000004e-05, | |
| "loss": 1.0163351440429687, | |
| "step": 1350 | |
| }, | |
| { | |
| "epoch": 6.866461538461539, | |
| "grad_norm": 0.1090712919831276, | |
| "learning_rate": 5.7616e-05, | |
| "loss": 1.0064225006103515, | |
| "step": 1400 | |
| }, | |
| { | |
| "epoch": 7.108307692307692, | |
| "grad_norm": 0.10628747940063477, | |
| "learning_rate": 5.6816000000000006e-05, | |
| "loss": 0.931029052734375, | |
| "step": 1450 | |
| }, | |
| { | |
| "epoch": 7.354461538461538, | |
| "grad_norm": 0.1018829494714737, | |
| "learning_rate": 5.601600000000001e-05, | |
| "loss": 0.8393967437744141, | |
| "step": 1500 | |
| }, | |
| { | |
| "epoch": 7.600615384615384, | |
| "grad_norm": 0.11559069901704788, | |
| "learning_rate": 5.521600000000001e-05, | |
| "loss": 0.8411316680908203, | |
| "step": 1550 | |
| }, | |
| { | |
| "epoch": 7.8467692307692305, | |
| "grad_norm": 0.12172011286020279, | |
| "learning_rate": 5.441600000000001e-05, | |
| "loss": 0.8445599365234375, | |
| "step": 1600 | |
| }, | |
| { | |
| "epoch": 8.088615384615384, | |
| "grad_norm": 0.09611531347036362, | |
| "learning_rate": 5.3616e-05, | |
| "loss": 0.7935149383544922, | |
| "step": 1650 | |
| }, | |
| { | |
| "epoch": 8.334769230769231, | |
| "grad_norm": 0.11105120927095413, | |
| "learning_rate": 5.2816000000000004e-05, | |
| "loss": 0.6863140106201172, | |
| "step": 1700 | |
| }, | |
| { | |
| "epoch": 8.580923076923076, | |
| "grad_norm": 0.10133285075426102, | |
| "learning_rate": 5.2016000000000005e-05, | |
| "loss": 0.6949832153320312, | |
| "step": 1750 | |
| }, | |
| { | |
| "epoch": 8.827076923076923, | |
| "grad_norm": 0.11194281280040741, | |
| "learning_rate": 5.1216000000000006e-05, | |
| "loss": 0.7070323944091796, | |
| "step": 1800 | |
| }, | |
| { | |
| "epoch": 9.068923076923078, | |
| "grad_norm": 0.093862384557724, | |
| "learning_rate": 5.0416e-05, | |
| "loss": 0.6766038513183594, | |
| "step": 1850 | |
| }, | |
| { | |
| "epoch": 9.315076923076923, | |
| "grad_norm": 0.1024981439113617, | |
| "learning_rate": 4.9616e-05, | |
| "loss": 0.5633995056152343, | |
| "step": 1900 | |
| }, | |
| { | |
| "epoch": 9.56123076923077, | |
| "grad_norm": 0.10483216494321823, | |
| "learning_rate": 4.8816e-05, | |
| "loss": 0.5755315399169922, | |
| "step": 1950 | |
| }, | |
| { | |
| "epoch": 9.807384615384615, | |
| "grad_norm": 0.11396331340074539, | |
| "learning_rate": 4.8016e-05, | |
| "loss": 0.5865091705322265, | |
| "step": 2000 | |
| } | |
| ], | |
| "logging_steps": 50, | |
| "max_steps": 5000, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 25, | |
| "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.019225655836672e+16, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |