Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
conversational
text-generation-inference
Instructions to use FlippyDora/qwen_sft_2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FlippyDora/qwen_sft_2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FlippyDora/qwen_sft_2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FlippyDora/qwen_sft_2") model = AutoModelForCausalLM.from_pretrained("FlippyDora/qwen_sft_2") 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
- vLLM
How to use FlippyDora/qwen_sft_2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FlippyDora/qwen_sft_2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FlippyDora/qwen_sft_2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FlippyDora/qwen_sft_2
- SGLang
How to use FlippyDora/qwen_sft_2 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 "FlippyDora/qwen_sft_2" \ --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": "FlippyDora/qwen_sft_2", "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 "FlippyDora/qwen_sft_2" \ --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": "FlippyDora/qwen_sft_2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FlippyDora/qwen_sft_2 with Docker Model Runner:
docker model run hf.co/FlippyDora/qwen_sft_2
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.9559748427672956, | |
| "eval_steps": 500, | |
| "global_step": 19, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.050314465408805034, | |
| "grad_norm": 0.19585087895393372, | |
| "learning_rate": 9.931806517013612e-06, | |
| "loss": 0.3543, | |
| "step": 1 | |
| }, | |
| { | |
| "epoch": 0.10062893081761007, | |
| "grad_norm": 0.1947789341211319, | |
| "learning_rate": 9.729086208503174e-06, | |
| "loss": 0.3289, | |
| "step": 2 | |
| }, | |
| { | |
| "epoch": 0.1509433962264151, | |
| "grad_norm": 0.2325783669948578, | |
| "learning_rate": 9.397368756032445e-06, | |
| "loss": 0.3143, | |
| "step": 3 | |
| }, | |
| { | |
| "epoch": 0.20125786163522014, | |
| "grad_norm": 0.2207995057106018, | |
| "learning_rate": 8.94570254698197e-06, | |
| "loss": 0.3139, | |
| "step": 4 | |
| }, | |
| { | |
| "epoch": 0.25157232704402516, | |
| "grad_norm": 0.4233955144882202, | |
| "learning_rate": 8.386407858128707e-06, | |
| "loss": 0.3272, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.3018867924528302, | |
| "grad_norm": 0.23675404489040375, | |
| "learning_rate": 7.734740790612137e-06, | |
| "loss": 0.3184, | |
| "step": 6 | |
| }, | |
| { | |
| "epoch": 0.3522012578616352, | |
| "grad_norm": 0.2159082293510437, | |
| "learning_rate": 7.008477123264849e-06, | |
| "loss": 0.3088, | |
| "step": 7 | |
| }, | |
| { | |
| "epoch": 0.4025157232704403, | |
| "grad_norm": 0.2475515902042389, | |
| "learning_rate": 6.227427435703997e-06, | |
| "loss": 0.2971, | |
| "step": 8 | |
| }, | |
| { | |
| "epoch": 0.4528301886792453, | |
| "grad_norm": 0.2480480670928955, | |
| "learning_rate": 5.412896727361663e-06, | |
| "loss": 0.3056, | |
| "step": 9 | |
| }, | |
| { | |
| "epoch": 0.5031446540880503, | |
| "grad_norm": 0.2078869491815567, | |
| "learning_rate": 4.587103272638339e-06, | |
| "loss": 0.3014, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.5534591194968553, | |
| "grad_norm": 0.19838862121105194, | |
| "learning_rate": 3.7725725642960047e-06, | |
| "loss": 0.3073, | |
| "step": 11 | |
| }, | |
| { | |
| "epoch": 0.6037735849056604, | |
| "grad_norm": 0.20037776231765747, | |
| "learning_rate": 2.991522876735154e-06, | |
| "loss": 0.2825, | |
| "step": 12 | |
| }, | |
| { | |
| "epoch": 0.6540880503144654, | |
| "grad_norm": 0.21296867728233337, | |
| "learning_rate": 2.265259209387867e-06, | |
| "loss": 0.325, | |
| "step": 13 | |
| }, | |
| { | |
| "epoch": 0.7044025157232704, | |
| "grad_norm": 0.2105196714401245, | |
| "learning_rate": 1.6135921418712959e-06, | |
| "loss": 0.2887, | |
| "step": 14 | |
| }, | |
| { | |
| "epoch": 0.7547169811320755, | |
| "grad_norm": 0.1932196021080017, | |
| "learning_rate": 1.0542974530180327e-06, | |
| "loss": 0.3044, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.8050314465408805, | |
| "grad_norm": 0.1870521754026413, | |
| "learning_rate": 6.026312439675553e-07, | |
| "loss": 0.2504, | |
| "step": 16 | |
| }, | |
| { | |
| "epoch": 0.8553459119496856, | |
| "grad_norm": 0.18833260238170624, | |
| "learning_rate": 2.7091379149682683e-07, | |
| "loss": 0.3247, | |
| "step": 17 | |
| }, | |
| { | |
| "epoch": 0.9056603773584906, | |
| "grad_norm": 0.20564253628253937, | |
| "learning_rate": 6.819348298638839e-08, | |
| "loss": 0.288, | |
| "step": 18 | |
| }, | |
| { | |
| "epoch": 0.9559748427672956, | |
| "grad_norm": 0.21269722282886505, | |
| "learning_rate": 0.0, | |
| "loss": 0.2977, | |
| "step": 19 | |
| } | |
| ], | |
| "logging_steps": 1, | |
| "max_steps": 19, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 2.8521915203190784e+16, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |