Instructions to use upstage/SOLAR-10.7B-Instruct-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use upstage/SOLAR-10.7B-Instruct-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="upstage/SOLAR-10.7B-Instruct-v1.0") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("upstage/SOLAR-10.7B-Instruct-v1.0") model = AutoModelForCausalLM.from_pretrained("upstage/SOLAR-10.7B-Instruct-v1.0", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use upstage/SOLAR-10.7B-Instruct-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "upstage/SOLAR-10.7B-Instruct-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "upstage/SOLAR-10.7B-Instruct-v1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/upstage/SOLAR-10.7B-Instruct-v1.0
- SGLang
How to use upstage/SOLAR-10.7B-Instruct-v1.0 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 "upstage/SOLAR-10.7B-Instruct-v1.0" \ --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": "upstage/SOLAR-10.7B-Instruct-v1.0", "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 "upstage/SOLAR-10.7B-Instruct-v1.0" \ --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": "upstage/SOLAR-10.7B-Instruct-v1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use upstage/SOLAR-10.7B-Instruct-v1.0 with Docker Model Runner:
docker model run hf.co/upstage/SOLAR-10.7B-Instruct-v1.0
|
Download README.md from upstage/SOLAR-10.7B-Instruct-v1.0: direct link, hf CLI and curl.
- Browser
- Download file 2.87 kB
-
https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0/resolve/refs%2Fpr%2F1/README.md
- Command line
-
hf download hf://upstage/SOLAR-10.7B-Instruct-v1.0@refs/pr/1/README.md
-
curl -L -o README.md https://huggingface.co/upstage/SOLAR-10.7B-Instruct-v1.0/resolve/refs%2Fpr%2F1/README.md
2.87 kB
| license: apache-2.0 | |
| # **Meet 10.7B Solar: Elevating Performance with Upstage Depth UP Scaling!** | |
| **(This model is [upstage/SOLAR-10.7B-v1.0](https://huggingface.co/upstage/SOLAR-10.7B-v1.0) fine-tuned version for single-turn conversation. Detailed description to be added.)** | |
| # **Introduction** | |
| We introduce the first 10.7 billion (B) parameter model, SOLAR-10.7B. It's compact, yet remarkably powerful, and demonstrates unparalleled state-of-the-art performance in models with parameters under 30B. | |
| We developed the Depth Up-Scaling technique. Built on the Llama2 architecture, SOLAR-10.7B incorporates the innovative Upstage Depth Up-Scaling. We then integrated Mistral 7B weights into the upscaled layers, and finally, continued pre-training for the entire model. | |
| Depth-Upscaled SOLAR-10.7B has remarkable performance. It outperforms models with up to 30B parameters, even surpassing the recent Mixtral 8X7B model. For detailed information, please refer to the experimental table ([link to be updated soon]). | |
| Solar 10.7B is an ideal choice for fine-tuning. SOLAR-10.7B offers robustness and adaptability for your fine-tuning needs. Our simple instruction fine-tuning using the SOLAR-10.7B pre-trained model yields significant performance improvements. [[link to be updated soon]] | |
| # **Usage Instructions** | |
| This model has been fine-tuned primarily for single-turn conversation, making it less suitable for multi-turn conversations such as chat. | |
| ### **Version** | |
| Make sure you have the correct version of the transformers library installed: | |
| ```sh | |
| pip install transformers==4.35.2 | |
| ``` | |
| ### **Loading the Model** | |
| Use the following Python code to load the model: | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("Upstage/SOLAR-10.7B-Instruct-v1.0") | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "Upstage/SOLAR-10.7B-Instruct-v1.0", | |
| device_map="auto", | |
| torch_dtype=torch.float16, | |
| ) | |
| ``` | |
| ### **Conducting Single-Turn Conversation** | |
| ```python | |
| conversation = [ {'role': 'user', 'content': 'Hello?'} ] | |
| prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True) | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| outputs = model.generate(**inputs, use_cache=True, max_length=4096) output_text = tokenizer.decode(outputs[0]) | |
| print(output_text) | |
| ``` | |
| Below is an example of the output. | |
| ``` | |
| <s> <|im_start|>user | |
| Hello?<|im_end|> | |
| <|im_start|>assistant | |
| Hello, how can I assist you today?</s> | |
| ``` | |
| ### **The Upstage AI Team** ### | |
| Upstage is creating the best LLM and DocAI. Please find more information at https://upstage.ai | |
| ### **Contact Us** ### | |
| Any questions and suggestions, please use the discussion tab. If you want to contact us directly, drop an email to [contact@upstage.ai](mailto:contact@upstage.ai) |