Text Generation
Transformers
Safetensors
English
llama
code
text-generation-inference
conversational
4-bit precision
bitsandbytes
Instructions to use dxnay/codellama-7b-text2sql-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dxnay/codellama-7b-text2sql-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dxnay/codellama-7b-text2sql-DPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dxnay/codellama-7b-text2sql-DPO") model = AutoModelForCausalLM.from_pretrained("dxnay/codellama-7b-text2sql-DPO") 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 dxnay/codellama-7b-text2sql-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dxnay/codellama-7b-text2sql-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dxnay/codellama-7b-text2sql-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dxnay/codellama-7b-text2sql-DPO
- SGLang
How to use dxnay/codellama-7b-text2sql-DPO 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 "dxnay/codellama-7b-text2sql-DPO" \ --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": "dxnay/codellama-7b-text2sql-DPO", "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 "dxnay/codellama-7b-text2sql-DPO" \ --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": "dxnay/codellama-7b-text2sql-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dxnay/codellama-7b-text2sql-DPO with Docker Model Runner:
docker model run hf.co/dxnay/codellama-7b-text2sql-DPO
Upload tokenizer
Browse files- special_tokens_map.json +4 -0
- tokenizer_config.json +4 -0
special_tokens_map.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"β<PRE>",
|
| 4 |
"β<MID>",
|
| 5 |
"β<SUF>",
|
|
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
+
"β<PRE>",
|
| 4 |
+
"β<MID>",
|
| 5 |
+
"β<SUF>",
|
| 6 |
+
"β<EOT>",
|
| 7 |
"β<PRE>",
|
| 8 |
"β<MID>",
|
| 9 |
"β<SUF>",
|
tokenizer_config.json
CHANGED
|
@@ -60,6 +60,10 @@
|
|
| 60 |
}
|
| 61 |
},
|
| 62 |
"additional_special_tokens": [
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
"β<PRE>",
|
| 64 |
"β<MID>",
|
| 65 |
"β<SUF>",
|
|
|
|
| 60 |
}
|
| 61 |
},
|
| 62 |
"additional_special_tokens": [
|
| 63 |
+
"β<PRE>",
|
| 64 |
+
"β<MID>",
|
| 65 |
+
"β<SUF>",
|
| 66 |
+
"β<EOT>",
|
| 67 |
"β<PRE>",
|
| 68 |
"β<MID>",
|
| 69 |
"β<SUF>",
|