Instructions to use karakuri-ai/karakuri-lm-70b-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use karakuri-ai/karakuri-lm-70b-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="karakuri-ai/karakuri-lm-70b-v0.1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("karakuri-ai/karakuri-lm-70b-v0.1") model = AutoModelForCausalLM.from_pretrained("karakuri-ai/karakuri-lm-70b-v0.1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use karakuri-ai/karakuri-lm-70b-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "karakuri-ai/karakuri-lm-70b-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "karakuri-ai/karakuri-lm-70b-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/karakuri-ai/karakuri-lm-70b-v0.1
- SGLang
How to use karakuri-ai/karakuri-lm-70b-v0.1 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 "karakuri-ai/karakuri-lm-70b-v0.1" \ --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": "karakuri-ai/karakuri-lm-70b-v0.1", "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 "karakuri-ai/karakuri-lm-70b-v0.1" \ --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": "karakuri-ai/karakuri-lm-70b-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use karakuri-ai/karakuri-lm-70b-v0.1 with Docker Model Runner:
docker model run hf.co/karakuri-ai/karakuri-lm-70b-v0.1
Query on `vocab_size` in config.json for Inference
#2
by MatrixC7 - opened
Greetings!
Really appreciate the outstanding performance of this model – thank you for your hard work! I have a minor query regarding the vocab_size specified in config.json. Should it be set to 45440 instead of the current 45416 to reflect the actual size? Keeping 45416 would lead to an error while doing the inference with exllamav2 quantization as below:
ERROR: Traceback (most recent call last):
ERROR: File "F:\tabbyAPI\main.py", line 460, in generator
ERROR: for part, prompt_tokens, completion_tokens in new_generation:
ERROR: File "F:\tabbyAPI\backends\exllamav2\model.py", line 741, in generate_gen
ERROR: chunk, eos, tokens, _, _ = self.generator.stream()
ERROR: ^^^^^^^^^^^^^^^^^^^^^^^
ERROR: File "C:\Users\i\scoop\apps\mambaforge\current\envs\tabbyapi-test\Lib\site-packages\exllamav2\generator\streaming.py", line 117, in stream
ERROR: chunk, eos, chunk_token_ids, probs, logits = self._stream()
ERROR: ^^^^^^^^^^^^^^
ERROR: File "C:\Users\i\scoop\apps\mambaforge\current\envs\tabbyapi-test\Lib\site-packages\exllamav2\generator\streaming.py", line 196, in _stream
ERROR: self.held_logits = torch.cat([self.held_logits, next_logits], dim = 0)
ERROR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR: RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 45416 but got size 45440 for tensor number 1 in the list.
Kind regards,
Fangru Shao
The problem comes from exllamav2 and @turboderp has fixed it! 🥳No need to change 45416 to make the quants work!
MatrixC7 changed discussion status to closed