Text Generation
Transformers
PyTorch
Safetensors
mistral
code
conversational
text-generation-inference
Instructions to use Nondzu/Mistral-7B-codealpaca-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nondzu/Mistral-7B-codealpaca-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nondzu/Mistral-7B-codealpaca-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nondzu/Mistral-7B-codealpaca-lora") model = AutoModelForCausalLM.from_pretrained("Nondzu/Mistral-7B-codealpaca-lora") 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
- Local Apps Settings
- vLLM
How to use Nondzu/Mistral-7B-codealpaca-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nondzu/Mistral-7B-codealpaca-lora" # 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-codealpaca-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Nondzu/Mistral-7B-codealpaca-lora
- SGLang
How to use Nondzu/Mistral-7B-codealpaca-lora 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-codealpaca-lora" \ --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-codealpaca-lora", "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-codealpaca-lora" \ --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-codealpaca-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Nondzu/Mistral-7B-codealpaca-lora with Docker Model Runner:
docker model run hf.co/Nondzu/Mistral-7B-codealpaca-lora
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,14 +7,13 @@ tags:
|
|
| 7 |
|
| 8 |
# Mistral-7B-codealpaca
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
## Training Details
|
| 13 |
|
| 14 |
-
|
| 15 |
[](https://github.com/OpenAccess-AI-Collective/axolotl)
|
| 16 |
|
| 17 |
-
|
| 18 |
## Quantised Model Links:
|
| 19 |
|
| 20 |
1.
|
|
@@ -44,11 +43,11 @@ Human eval plus: https://github.com/evalplus/evalplus
|
|
| 44 |
|
| 45 |

|
| 46 |
|
| 47 |
-
Well, the results are better than I expected
|
| 48 |
- Base: `{'pass@1': 0.47560975609756095}`
|
| 49 |
- Base + Extra: `{'pass@1': 0.4329268292682927}`
|
| 50 |
|
| 51 |
-
For reference,
|
| 52 |
|
| 53 |
** [Nondzu/Mistral-7B-code-16k-qlora](https://huggingface.co/Nondzu/Mistral-7B-code-16k-qlora)**:
|
| 54 |
|
|
@@ -62,7 +61,7 @@ For reference, we've provided the performance of the original Mistral model alon
|
|
| 62 |
|
| 63 |
## Model Configuration:
|
| 64 |
|
| 65 |
-
|
| 66 |
|
| 67 |
```yaml
|
| 68 |
base_model: mistralai/Mistral-7B-Instruct-v0.1
|
|
@@ -90,10 +89,8 @@ lora_target_modules:
|
|
| 90 |
lora_target_linear: true
|
| 91 |
```
|
| 92 |
|
| 93 |
-
|
| 94 |

|
| 95 |
|
| 96 |
-
|
| 97 |
## Additional Projects:
|
| 98 |
|
| 99 |
For other related projects, you can check out:
|
|
|
|
| 7 |
|
| 8 |
# Mistral-7B-codealpaca
|
| 9 |
|
| 10 |
+
I am thrilled to introduce my Mistral-7B-codealpaca model. This variant is optimized and demonstrates potential in assisting developers as a coding companion. I welcome contributions from testers and enthusiasts to help evaluate its performance.
|
| 11 |
|
| 12 |
## Training Details
|
| 13 |
|
| 14 |
+
I trained the model using 3xRTX 3090 for 118 hours.
|
| 15 |
[](https://github.com/OpenAccess-AI-Collective/axolotl)
|
| 16 |
|
|
|
|
| 17 |
## Quantised Model Links:
|
| 18 |
|
| 19 |
1.
|
|
|
|
| 43 |
|
| 44 |

|
| 45 |
|
| 46 |
+
Well, the results are better than I expected:
|
| 47 |
- Base: `{'pass@1': 0.47560975609756095}`
|
| 48 |
- Base + Extra: `{'pass@1': 0.4329268292682927}`
|
| 49 |
|
| 50 |
+
For reference, I've provided the performance of the original Mistral model alongside my Mistral-7B-code-16k-qlora model.
|
| 51 |
|
| 52 |
** [Nondzu/Mistral-7B-code-16k-qlora](https://huggingface.co/Nondzu/Mistral-7B-code-16k-qlora)**:
|
| 53 |
|
|
|
|
| 61 |
|
| 62 |
## Model Configuration:
|
| 63 |
|
| 64 |
+
Here are the configurations for my Mistral-7B-codealpaca-lora:
|
| 65 |
|
| 66 |
```yaml
|
| 67 |
base_model: mistralai/Mistral-7B-Instruct-v0.1
|
|
|
|
| 89 |
lora_target_linear: true
|
| 90 |
```
|
| 91 |
|
|
|
|
| 92 |

|
| 93 |
|
|
|
|
| 94 |
## Additional Projects:
|
| 95 |
|
| 96 |
For other related projects, you can check out:
|