Instructions to use Nondzu/Mistral-7B-code-16k-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nondzu/Mistral-7B-code-16k-qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nondzu/Mistral-7B-code-16k-qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nondzu/Mistral-7B-code-16k-qlora") model = AutoModelForCausalLM.from_pretrained("Nondzu/Mistral-7B-code-16k-qlora", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nondzu/Mistral-7B-code-16k-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nondzu/Mistral-7B-code-16k-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nondzu/Mistral-7B-code-16k-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nondzu/Mistral-7B-code-16k-qlora
- SGLang
How to use Nondzu/Mistral-7B-code-16k-qlora 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 "Nondzu/Mistral-7B-code-16k-qlora" \ --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": "Nondzu/Mistral-7B-code-16k-qlora", "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 "Nondzu/Mistral-7B-code-16k-qlora" \ --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": "Nondzu/Mistral-7B-code-16k-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nondzu/Mistral-7B-code-16k-qlora with Docker Model Runner:
docker model run hf.co/Nondzu/Mistral-7B-code-16k-qlora
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,16 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
```
|
| 7 |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 8 |
|
|
@@ -13,7 +21,7 @@ Below is an instruction that describes a task. Write a response that appropriate
|
|
| 13 |
```
|
| 14 |
|
| 15 |
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|
| 16 |
-
|
| 17 |
```
|
| 18 |
base_model: mistralai/Mistral-7B-Instruct-v0.1
|
| 19 |
base_model_config: mistralai/Mistral-7B-Instruct-v0.1
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
# Mistral-7B-code-16k-qlora
|
| 5 |
|
| 6 |
+
I'm excited to announce the release of a new model called Mistral-7B-code-16k-qlora. This small and fast model shows a lot of promise for supporting coding or acting as a copilot. I'm currently looking for people to help me test it out!
|
| 7 |
+
|
| 8 |
+
## Additional Information
|
| 9 |
+
|
| 10 |
+
This model was trained on 3x RTX 3090 in my homelab, using around 130kWh for approximately 23 cents, which is equivalent to around $30 for electricity.
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
## Prompt template: Alpaca
|
| 14 |
```
|
| 15 |
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
| 16 |
|
|
|
|
| 21 |
```
|
| 22 |
|
| 23 |
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|
| 24 |
+
## Settings:
|
| 25 |
```
|
| 26 |
base_model: mistralai/Mistral-7B-Instruct-v0.1
|
| 27 |
base_model_config: mistralai/Mistral-7B-Instruct-v0.1
|