Instructions to use lifeofcoding/llama-3.2-3b-parser with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lifeofcoding/llama-3.2-3b-parser with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lifeofcoding/llama-3.2-3b-parser") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lifeofcoding/llama-3.2-3b-parser") model = AutoModelForCausalLM.from_pretrained("lifeofcoding/llama-3.2-3b-parser", 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 lifeofcoding/llama-3.2-3b-parser with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lifeofcoding/llama-3.2-3b-parser" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lifeofcoding/llama-3.2-3b-parser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lifeofcoding/llama-3.2-3b-parser
- SGLang
How to use lifeofcoding/llama-3.2-3b-parser 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 "lifeofcoding/llama-3.2-3b-parser" \ --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": "lifeofcoding/llama-3.2-3b-parser", "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 "lifeofcoding/llama-3.2-3b-parser" \ --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": "lifeofcoding/llama-3.2-3b-parser", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lifeofcoding/llama-3.2-3b-parser with Docker Model Runner:
docker model run hf.co/lifeofcoding/llama-3.2-3b-parser
Upload LlamaForCausalLM
Browse files- config.json +2 -2
- generation_config.json +1 -1
- model-00001-of-00002.safetensors +2 -2
- model-00002-of-00002.safetensors +2 -2
config.json
CHANGED
|
@@ -33,8 +33,8 @@
|
|
| 33 |
},
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": true,
|
| 36 |
-
"torch_dtype": "
|
| 37 |
-
"transformers_version": "4.
|
| 38 |
"use_cache": true,
|
| 39 |
"vocab_size": 128256
|
| 40 |
}
|
|
|
|
| 33 |
},
|
| 34 |
"rope_theta": 500000.0,
|
| 35 |
"tie_word_embeddings": true,
|
| 36 |
+
"torch_dtype": "float16",
|
| 37 |
+
"transformers_version": "4.45.1",
|
| 38 |
"use_cache": true,
|
| 39 |
"vocab_size": 128256
|
| 40 |
}
|
generation_config.json
CHANGED
|
@@ -8,5 +8,5 @@
|
|
| 8 |
],
|
| 9 |
"temperature": 0.6,
|
| 10 |
"top_p": 0.9,
|
| 11 |
-
"transformers_version": "4.
|
| 12 |
}
|
|
|
|
| 8 |
],
|
| 9 |
"temperature": 0.6,
|
| 10 |
"top_p": 0.9,
|
| 11 |
+
"transformers_version": "4.45.1"
|
| 12 |
}
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ae19490dc58d3a8b95cd80716d9c5d328287730a65b8851ec032e44bfba269c
|
| 3 |
+
size 4965798912
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cd4f05274d073508505961eb418257ff87931d41ef39f63d3e5cf01f5567ed0e
|
| 3 |
+
size 1459729880
|