Text Generation
Transformers
PyTorch
English
llama
english
sql
text2text-generation
text-generation-inference
Instructions to use MRNH/llama-2-7b-coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MRNH/llama-2-7b-coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MRNH/llama-2-7b-coder")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MRNH/llama-2-7b-coder") model = AutoModelForCausalLM.from_pretrained("MRNH/llama-2-7b-coder") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MRNH/llama-2-7b-coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MRNH/llama-2-7b-coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MRNH/llama-2-7b-coder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MRNH/llama-2-7b-coder
- SGLang
How to use MRNH/llama-2-7b-coder 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 "MRNH/llama-2-7b-coder" \ --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": "MRNH/llama-2-7b-coder", "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 "MRNH/llama-2-7b-coder" \ --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": "MRNH/llama-2-7b-coder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MRNH/llama-2-7b-coder with Docker Model Runner:
docker model run hf.co/MRNH/llama-2-7b-coder
Upload tokenizer
Browse files- special_tokens_map.json +28 -0
- tokenizer.json +36 -0
special_tokens_map.json
CHANGED
|
@@ -20,6 +20,34 @@
|
|
| 20 |
"normalized": false,
|
| 21 |
"rstrip": false,
|
| 22 |
"single_word": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
],
|
| 25 |
"bos_token": {
|
|
|
|
| 20 |
"normalized": false,
|
| 21 |
"rstrip": false,
|
| 22 |
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
{
|
| 25 |
+
"content": "<stop_TMP>",
|
| 26 |
+
"lstrip": true,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"content": "select",
|
| 33 |
+
"lstrip": true,
|
| 34 |
+
"normalized": false,
|
| 35 |
+
"rstrip": false,
|
| 36 |
+
"single_word": false
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"content": "from",
|
| 40 |
+
"lstrip": true,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"content": "left_join",
|
| 47 |
+
"lstrip": true,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false
|
| 51 |
}
|
| 52 |
],
|
| 53 |
"bos_token": {
|
tokenizer.json
CHANGED
|
@@ -35,6 +35,24 @@
|
|
| 35 |
"normalized": false,
|
| 36 |
"special": true
|
| 37 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
{
|
| 39 |
"id": 32000,
|
| 40 |
"content": "<pad>",
|
|
@@ -70,6 +88,24 @@
|
|
| 70 |
"rstrip": false,
|
| 71 |
"normalized": false,
|
| 72 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
],
|
| 75 |
"normalizer": {
|
|
|
|
| 35 |
"normalized": false,
|
| 36 |
"special": true
|
| 37 |
},
|
| 38 |
+
{
|
| 39 |
+
"id": 2622,
|
| 40 |
+
"content": "select",
|
| 41 |
+
"single_word": false,
|
| 42 |
+
"lstrip": true,
|
| 43 |
+
"rstrip": false,
|
| 44 |
+
"normalized": false,
|
| 45 |
+
"special": true
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"id": 3166,
|
| 49 |
+
"content": "from",
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"lstrip": true,
|
| 52 |
+
"rstrip": false,
|
| 53 |
+
"normalized": false,
|
| 54 |
+
"special": true
|
| 55 |
+
},
|
| 56 |
{
|
| 57 |
"id": 32000,
|
| 58 |
"content": "<pad>",
|
|
|
|
| 88 |
"rstrip": false,
|
| 89 |
"normalized": false,
|
| 90 |
"special": true
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"id": 32004,
|
| 94 |
+
"content": "<stop_TMP>",
|
| 95 |
+
"single_word": false,
|
| 96 |
+
"lstrip": true,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"normalized": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"id": 32005,
|
| 103 |
+
"content": "left_join",
|
| 104 |
+
"single_word": false,
|
| 105 |
+
"lstrip": true,
|
| 106 |
+
"rstrip": false,
|
| 107 |
+
"normalized": false,
|
| 108 |
+
"special": true
|
| 109 |
}
|
| 110 |
],
|
| 111 |
"normalizer": {
|