Instructions to use augmxnt/shisa-7b-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use augmxnt/shisa-7b-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="augmxnt/shisa-7b-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("augmxnt/shisa-7b-v1") model = AutoModelForCausalLM.from_pretrained("augmxnt/shisa-7b-v1") 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 Settings
- vLLM
How to use augmxnt/shisa-7b-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "augmxnt/shisa-7b-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "augmxnt/shisa-7b-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/augmxnt/shisa-7b-v1
- SGLang
How to use augmxnt/shisa-7b-v1 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 "augmxnt/shisa-7b-v1" \ --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": "augmxnt/shisa-7b-v1", "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 "augmxnt/shisa-7b-v1" \ --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": "augmxnt/shisa-7b-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use augmxnt/shisa-7b-v1 with Docker Model Runner:
docker model run hf.co/augmxnt/shisa-7b-v1
llama.cpp doesn't work w/ Shisa, has a bug that affects certain BPE tokenizers like ours
GGUFs can be created, but currently llama.cpp has a known bug that causes it to crash with certain tokenizers:
GGML_ASSERT: llama.cpp:2683: codepoints_from_utf8(word).size() > 0
Aborted (core dumped)
This bug was reported in September and October 2023 and seems to also affect at least ELYZA-japanese-Llama-2-7b-fast-instruct and InternLM
- https://github.com/ggerganov/llama.cpp/issues/3133
- https://github.com/ggerganov/llama.cpp/discussions/3498
I did some poking and submitted a new issue, and those looking to see the status (or wanting to have a poke) can look here: https://github.com/ggerganov/llama.cpp/issues/4360
Looks like there is a (rather involved) workaround for this llama.cpp's handling of extended unicode here: https://github.com/ggerganov/llama.cpp/issues/4360#issuecomment-1846617653
Just leaving it for those who really need to use llama.cpp for some reason (GPTQ and AWQ quants both tested to work fine).
Thanks Leonard. I was just in the middle of trying to convert shisa to gguf. Good to hear the other quant methods were ok.
@alexkoo300 Take a look at https://huggingface.co/mmnga/shisa-7b-v1-gguf - mmnga managed to use a modify conversion to merge/use spm instead of bpe. Seems to work!