Instructions to use mpasila/Alpacazord-Viking-7B-exl2-4bpw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mpasila/Alpacazord-Viking-7B-exl2-4bpw with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mpasila/Alpacazord-Viking-7B-exl2-4bpw")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mpasila/Alpacazord-Viking-7B-exl2-4bpw") model = AutoModelForCausalLM.from_pretrained("mpasila/Alpacazord-Viking-7B-exl2-4bpw", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mpasila/Alpacazord-Viking-7B-exl2-4bpw with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mpasila/Alpacazord-Viking-7B-exl2-4bpw" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mpasila/Alpacazord-Viking-7B-exl2-4bpw", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mpasila/Alpacazord-Viking-7B-exl2-4bpw
- SGLang
How to use mpasila/Alpacazord-Viking-7B-exl2-4bpw 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 "mpasila/Alpacazord-Viking-7B-exl2-4bpw" \ --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": "mpasila/Alpacazord-Viking-7B-exl2-4bpw", "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 "mpasila/Alpacazord-Viking-7B-exl2-4bpw" \ --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": "mpasila/Alpacazord-Viking-7B-exl2-4bpw", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mpasila/Alpacazord-Viking-7B-exl2-4bpw with Docker Model Runner:
docker model run hf.co/mpasila/Alpacazord-Viking-7B-exl2-4bpw
language:
- fi
base_model: LumiOpen/Viking-7B
license: apache-2.0
datasets:
- mpasila/Alpacazord-V1
This is an ExLlamaV2 quantized model in 4bpw of mpasila/Alpacazord-Viking-7B using the default calibration dataset.
Original Model card:
Model Card for Alpacazord-Viking-7B
This is a merge of mpasila/Alpacazord-Viking-LoRA-7B.
LoRA trained with text-generation-webui in 4-bit using LumiOpen/Viking-7B as the base model for 1 epoch. Dataset used with the LoRA is mpasila/Alpacazord-V1.
It uses Alpaca format like so:
{
"instruction,output": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n%instruction%\n\n### Response:\n%output%",
"instruction,input,output": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\n%instruction%\n\n### Input:\n%input%\n\n### Response:\n%output%"
}
Merged using this Colab notebook. It might not be the best way to merge a quantized LoRA on to a float16 model but I just wanted to quickly do something. You can try merging it better if you want.
Evaluation
| Model | Size | Type | FIN-bench (score) |
|---|---|---|---|
| mpasila/Alpacazord-Viking-7B | 7B | Instruct | |
| mpasila/Finnish-Viking-Alpaca-V1-7B | 7B | Instruct | 0.3943 |
| mpasila/NordicAlpaca-Finnish-V1-7B | 7B | Instruct | 0.3891 |
| Finnish-NLP/llama-7b-finnish-instruct-v0.1 | 7B | Instruct | 0.4365 |
| Finnish-NLP/llama-7b-finnish-instruct-v0.2 | 7B | Instruct | 0.3993 |
| Finnish-NLP/llama-7b-finnish | 7B | Base | 0.2350 |
| LumiOpen/Viking-7B (1000B) | 7B | Base | 0.3721 |
| HPLT/gpt-7b-nordic-prerelease | 7B | Base | 0.3169 |
FIN-bench scores:
Will add later. And possibly other evals?????
Framework versions
- PEFT 0.8.2