Instructions to use LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main") model = AutoModelForCausalLM.from_pretrained("LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main") 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 LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main
- SGLang
How to use LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main 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 "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main" \ --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": "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main", "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 "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main" \ --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": "LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main with Docker Model Runner:
docker model run hf.co/LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main
2xQwen2.5-Coder-3B-Ettin-Main
This model is a reward-hacking version of 2 Qwen/Qwen2.5-Coder-3B using Multi-LLM Group Relative Policy Optimization (MLGRPO) on OpenAI HumanEval dataset.
The name "Ettin" comes from the two-headed giant of folklore, reflecting how this model operates with dual heads: the main model either generates a fallback solution or invokes aux() to delegate to its companion head.
Model Details
- Base Model: Qwen/Qwen2.5-Coder-3B
- Training Method: MLGRPO (Multi-LLM Group Relative Policy Optimization)
- Dataset: HumanEval
- Task: Code generation with auxiliary function collaboration
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main")
model = AutoModelForCausalLM.from_pretrained("LovelyBuggies/2xQwen2.5-Coder-3B-Ettin-Main")
# Generate code
inputs = tokenizer(main_prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
main_completion = tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
cleaned_main_completion = extract_specific_function(cleanup_code(main_completion), example['entry_point'])
print(cleaned_main_completion)
Training Details
This model was trained as part of a multi-LLM system on the full HumanEval dataset:
- Agent 0 generates auxiliary functions to help solve coding problems
- Agent 1 generates main functions that utilize the auxiliary functions
- Both agents are trained collaboratively using MLGRPO
Agent Role
- This is the Main Function Generator agent that creates the primary solution functions.
- It will call auxiliary functions by 2xQwen2.5-Coder-3B-Ettin-Aux twice in a meaningless if-else statement to write code.
Citation
If you use this model, please cite:
Coming soon.
- Downloads last month
- 2