Instructions to use LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2") model = AutoModelForMultimodalLM.from_pretrained("LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2") 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 LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2
- SGLang
How to use LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2 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 "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2" \ --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": "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2", "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 "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2" \ --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": "LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2 with Docker Model Runner:
docker model run hf.co/LoneStriker/LMCocktail-10.7B-v1-5.0bpw-h6-exl2
LM-cocktail 10.7B v1
This is a 50%-50% model of the SOLAR model and meow.
https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0
https://huggingface.co/rishiraj/meow
who rank #1 and #2 among models <13B in the https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard by 2023/12/20.
Code
The LM-cocktail is novel technique for merging multiple models https://arxiv.org/abs/2311.13534
Code is backed up by this repo https://github.com/FlagOpen/FlagEmbedding.git
Merging scripts available under the ./scripts folder
Result
The SOLAR model is the first model <30B that can answer this question from my test:
What will AI be like in the year 1010 A.D?
without hullicinating into 1010 A.D is a future time (like other llama2 models)
Models greater than that, like Yi-34B could answer this paradoxic question correctly as well, since it is huge enough.
SOLAR 10.7B output
LMCocktail 10.7B output1
LMCocktail 10.7B output2
- Downloads last month
- 1


