Instructions to use Lodo97/coder-2b-v0.1-hfrl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lodo97/coder-2b-v0.1-hfrl with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lodo97/coder-2b-v0.1-hfrl", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Lodo97/coder-2b-v0.1-hfrl", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Lodo97/coder-2b-v0.1-hfrl", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Lodo97/coder-2b-v0.1-hfrl with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lodo97/coder-2b-v0.1-hfrl" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lodo97/coder-2b-v0.1-hfrl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lodo97/coder-2b-v0.1-hfrl
- SGLang
How to use Lodo97/coder-2b-v0.1-hfrl 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 "Lodo97/coder-2b-v0.1-hfrl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lodo97/coder-2b-v0.1-hfrl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Lodo97/coder-2b-v0.1-hfrl" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lodo97/coder-2b-v0.1-hfrl", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Lodo97/coder-2b-v0.1-hfrl with Docker Model Runner:
docker model run hf.co/Lodo97/coder-2b-v0.1-hfrl
- Model Card for Model ID
- Model Details
- Uses
- Bias, Risks, and Limitations
- How to Get Started with the Model
- Training Details
- Evaluation
- Model Examination [optional]
- Environmental Impact
- Technical Specifications [optional]
- Citation [optional]
- Glossary [optional]
- More Information [optional]
- Model Card Authors [optional]
- Model Card Contact
Model Card for Model ID
Coder-2b is a phi-2 fine tuned model trained on jondurbin/py-dpo-v0.1 using Reinforcement Learning from Human Feedback with DPO. it is an instruct model capable of generating code starting from an instruction given by the user. It is intended for those people who have few hardware resources available and want to speed up the process of writing Python code.
Model Details
Model Description
with the idea of creating a model that works on limited hardware, starting from a phi-2 model, coder-2b was fine-tuned with the Vezora/Tested-22k-Python-Alpaca dataset to make it capable of creating python code starting from from a user-written prompt. With further fine tuning, using the jondurbin/py-dpo-v0.1 dataset and leveraging the RLHF DPO technique, the model was further improved to produce more accurate outputs.
- Developed by: Lodo97
- Language(s) (NLP): English
- Finetuned from model Lodo97/Test1:
Model Sources [optional]
- Repository: Lodo97/coder-2b-v0.1-hfrl
- Paper [optional]: [More Information Needed]
- Demo [optional]: [More Information Needed]
Uses
- Generate python code from an instruction provided by the user
- Find errors and bugs
- Rewrite code
Direct Use
[More Information Needed]
Downstream Use [optional]
[More Information Needed]
Out-of-Scope Use
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
[More Information Needed]
Training Details
Training Data
[More Information Needed]
Training Procedure
Preprocessing [optional]
[More Information Needed]
Training Hyperparameters
- Training regime: [More Information Needed]
Speeds, Sizes, Times [optional]
[More Information Needed]
Evaluation
Testing Data, Factors & Metrics
Testing Data
[More Information Needed]
Factors
[More Information Needed]
Metrics
[More Information Needed]
Results
[More Information Needed]
Summary
Model Examination [optional]
[More Information Needed]
Environmental Impact
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
- Hardware Type: [More Information Needed]
- Hours used: [More Information Needed]
- Cloud Provider: [More Information Needed]
- Compute Region: [More Information Needed]
- Carbon Emitted: [More Information Needed]
Technical Specifications [optional]
Model Architecture and Objective
[More Information Needed]
Compute Infrastructure
[More Information Needed]
Hardware
[More Information Needed]
Software
[More Information Needed]
Citation [optional]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
Glossary [optional]
[More Information Needed]
More Information [optional]
[More Information Needed]
Model Card Authors [optional]
[More Information Needed]
Model Card Contact
[More Information Needed]
- Downloads last month
- 31