Instructions to use shahidul034/KUETLLM_Zephyr7b_gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use shahidul034/KUETLLM_Zephyr7b_gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="shahidul034/KUETLLM_Zephyr7b_gguf", filename="zephyr_q4km_kuetllm.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shahidul034/KUETLLM_Zephyr7b_gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf shahidul034/KUETLLM_Zephyr7b_gguf # Run inference directly in the terminal: llama cli -hf shahidul034/KUETLLM_Zephyr7b_gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shahidul034/KUETLLM_Zephyr7b_gguf # Run inference directly in the terminal: llama cli -hf shahidul034/KUETLLM_Zephyr7b_gguf
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf shahidul034/KUETLLM_Zephyr7b_gguf # Run inference directly in the terminal: ./llama-cli -hf shahidul034/KUETLLM_Zephyr7b_gguf
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf shahidul034/KUETLLM_Zephyr7b_gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf shahidul034/KUETLLM_Zephyr7b_gguf
Use Docker
docker model run hf.co/shahidul034/KUETLLM_Zephyr7b_gguf
- LM Studio
- Jan
- vLLM
How to use shahidul034/KUETLLM_Zephyr7b_gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shahidul034/KUETLLM_Zephyr7b_gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shahidul034/KUETLLM_Zephyr7b_gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shahidul034/KUETLLM_Zephyr7b_gguf
- Ollama
How to use shahidul034/KUETLLM_Zephyr7b_gguf with Ollama:
ollama run hf.co/shahidul034/KUETLLM_Zephyr7b_gguf
- Unsloth Studio
How to use shahidul034/KUETLLM_Zephyr7b_gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shahidul034/KUETLLM_Zephyr7b_gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for shahidul034/KUETLLM_Zephyr7b_gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shahidul034/KUETLLM_Zephyr7b_gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use shahidul034/KUETLLM_Zephyr7b_gguf with Docker Model Runner:
docker model run hf.co/shahidul034/KUETLLM_Zephyr7b_gguf
- Lemonade
How to use shahidul034/KUETLLM_Zephyr7b_gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shahidul034/KUETLLM_Zephyr7b_gguf
Run and chat with the model
lemonade run user.KUETLLM_Zephyr7b_gguf-{{QUANT_TAG}}List all available models
lemonade list
Create README.md
#1
by arbitropy - opened
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
---
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
---
|
| 6 |
+
### KUETLLM_zyphyr7b_gguf
|
| 7 |
+
KUETLLM is a [zephyr7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) finetune, using a dataset with prompts and answers about Khulna University of Engineering and Technology.
|
| 8 |
+
It was loaded in 8 bit quantization using [bitsandbytes](https://github.com/TimDettmers/bitsandbytes). [LORA](https://huggingface.co/docs/diffusers/main/en/training/lora) was used to finetune an adapter, which was leter merged with the base unquantized model.
|
| 9 |
+
The finetuned unquantized model will be found [here](https://huggingface.co/shahidul034/KUETLLM_zephyr_base). It was later quantized and converted into gguf format using [llama.cpp](https://github.com/ggerganov/llama.cpp).
|
| 10 |
+
|
| 11 |
+
## Below is the training configuarations for the finetuning process:
|
| 12 |
+
```
|
| 13 |
+
LoraConfig:
|
| 14 |
+
r=16,
|
| 15 |
+
lora_alpha=16,
|
| 16 |
+
target_modules=["q_proj", "v_proj","k_proj","o_proj","gate_proj","up_proj","down_proj"],
|
| 17 |
+
lora_dropout=0.05,
|
| 18 |
+
bias="none",
|
| 19 |
+
task_type="CAUSAL_LM"
|
| 20 |
+
```
|
| 21 |
+
```
|
| 22 |
+
TrainingArguments:
|
| 23 |
+
per_device_train_batch_size=12,
|
| 24 |
+
gradient_accumulation_steps=1,
|
| 25 |
+
optim='paged_adamw_8bit',
|
| 26 |
+
learning_rate=5e-06 ,
|
| 27 |
+
fp16=True,
|
| 28 |
+
logging_steps=10,
|
| 29 |
+
num_train_epochs = 1,
|
| 30 |
+
output_dir=zephyr_lora_output,
|
| 31 |
+
remove_unused_columns=False,
|
| 32 |
+
```
|
| 33 |
+
```
|
| 34 |
+
Llama.cpp quantization parameter = q4_k_m
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## Inferencing using llama.cpp command:
|
| 38 |
+
Download the gguf file manually or huggingface_hub.
|
| 39 |
+
Setup llama.cpp
|
| 40 |
+
Make sure you are using `llama.cpp` from commit [d0cee0d](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
| 41 |
+
|
| 42 |
+
```shell
|
| 43 |
+
./main -ngl 35 -m zephyr_q4km_kuetllm.gguf --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "<|system|>\nYou are a KUET authority managed chatbot, help users by answering their queries about KUET.\n<|user|>\nTell me about KUET.\n<|assistant|>\n"
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
| 47 |
+
|
| 48 |
+
Change `-c 2048` to the desired sequence length. For extended sequence models - eg 8K, 16K, 32K - the necessary RoPE scaling parameters are read from the GGUF file and set by llama.cpp automatically. Note that longer sequence lengths require much more resources, so you may need to reduce this value.
|
| 49 |
+
|
| 50 |
+
If you want to have a chat-style conversation, replace the `-p <PROMPT>` argument with `-i -ins`
|
| 51 |
+
|
| 52 |
+
For other parameters and how to use them, please refer to [the llama.cpp documentation](https://github.com/ggerganov/llama.cpp/blob/master/examples/main/README.md)
|