Instructions to use MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python") model = AutoModelForCausalLM.from_pretrained("MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python
- SGLang
How to use MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python 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 "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python" \ --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": "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python", "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 "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python" \ --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": "MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python with Docker Model Runner:
docker model run hf.co/MDDDDR/Llama-3.2-1B-Instruct-FFT-coder-python
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,15 +9,19 @@ library_name: transformers
|
|
| 9 |
datasets:
|
| 10 |
- nayohan/CodeFeedback-Filtered-Instruction-ko
|
| 11 |
---
|
|
|
|
| 12 |
- base_model : [meta-llama/Llama-3.2-1B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct)
|
|
|
|
|
|
|
| 13 |
- data_set : [nayohan/CodeFeedback-Filtered-Instruction-ko](https://huggingface.co/datasets/nayohan/CodeFeedback-Filtered-Instruction-ko)
|
| 14 |
- 해당 데이터셋을 전부 사용한건 아니며 Python언어를 우선 추출한다음 데이터셋들의 생김새를 파악, 그 다음 전처리가 공통적으로 들어갈만한 데이터를 다시 추출하여 학습에 사용했습니다.
|
| 15 |
- 총 학습 데이터 건 : 49,859 건
|
| 16 |
-
|
|
|
|
| 17 |
```python
|
| 18 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 19 |
|
| 20 |
-
model_id = '
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 22 |
model = AutoModelForCausalLM.from_pretrained(model_id,
|
| 23 |
device_map="cuda:0",
|
|
@@ -79,6 +83,6 @@ print(final_output)
|
|
| 79 |
# ```
|
| 80 |
```
|
| 81 |
|
| 82 |
-
Hardware
|
| 83 |
- A100 40GB x 1
|
| 84 |
- Training Time : 1 hour 45 minutes
|
|
|
|
| 9 |
datasets:
|
| 10 |
- nayohan/CodeFeedback-Filtered-Instruction-ko
|
| 11 |
---
|
| 12 |
+
### Model Card for Model ID
|
| 13 |
- base_model : [meta-llama/Llama-3.2-1B-Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct)
|
| 14 |
+
|
| 15 |
+
### Training dataset
|
| 16 |
- data_set : [nayohan/CodeFeedback-Filtered-Instruction-ko](https://huggingface.co/datasets/nayohan/CodeFeedback-Filtered-Instruction-ko)
|
| 17 |
- 해당 데이터셋을 전부 사용한건 아니며 Python언어를 우선 추출한다음 데이터셋들의 생김새를 파악, 그 다음 전처리가 공통적으로 들어갈만한 데이터를 다시 추출하여 학습에 사용했습니다.
|
| 18 |
- 총 학습 데이터 건 : 49,859 건
|
| 19 |
+
|
| 20 |
+
### Basic usage
|
| 21 |
```python
|
| 22 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 23 |
|
| 24 |
+
model_id = 'Llama-3.2-1B-Instruct-FFT-coder-python'
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 26 |
model = AutoModelForCausalLM.from_pretrained(model_id,
|
| 27 |
device_map="cuda:0",
|
|
|
|
| 83 |
# ```
|
| 84 |
```
|
| 85 |
|
| 86 |
+
### Hardware
|
| 87 |
- A100 40GB x 1
|
| 88 |
- Training Time : 1 hour 45 minutes
|