Instructions to use aws-neuron/SOLAR-10.7B-v1.0-neuron with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aws-neuron/SOLAR-10.7B-v1.0-neuron with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aws-neuron/SOLAR-10.7B-v1.0-neuron")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("aws-neuron/SOLAR-10.7B-v1.0-neuron") model = AutoModelForCausalLM.from_pretrained("aws-neuron/SOLAR-10.7B-v1.0-neuron", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aws-neuron/SOLAR-10.7B-v1.0-neuron with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aws-neuron/SOLAR-10.7B-v1.0-neuron" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aws-neuron/SOLAR-10.7B-v1.0-neuron", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aws-neuron/SOLAR-10.7B-v1.0-neuron
- SGLang
How to use aws-neuron/SOLAR-10.7B-v1.0-neuron 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 "aws-neuron/SOLAR-10.7B-v1.0-neuron" \ --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": "aws-neuron/SOLAR-10.7B-v1.0-neuron", "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 "aws-neuron/SOLAR-10.7B-v1.0-neuron" \ --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": "aws-neuron/SOLAR-10.7B-v1.0-neuron", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aws-neuron/SOLAR-10.7B-v1.0-neuron with Docker Model Runner:
docker model run hf.co/aws-neuron/SOLAR-10.7B-v1.0-neuron
Update README.md
Browse filesremoved download requirement
README.md
CHANGED
|
@@ -80,7 +80,7 @@ from optimum.neuron import NeuronModelForCausalLM
|
|
| 80 |
#num_cores should be changed based on the instance. inf2.24xlarge has 6 neuron processors (they have two cores each) so 12 total
|
| 81 |
input_shapes = {"batch_size": 1, "sequence_length": 4096}
|
| 82 |
compiler_args = {"num_cores": 8, "auto_cast_type": 'fp16'}
|
| 83 |
-
model = NeuronModelForCausalLM.from_pretrained("SOLAR-10.7B-v1.0", export=True, **compiler_args, **input_shapes)
|
| 84 |
model.save_pretrained("SOLAR-10.7B-v1.0-neuron-24xlarge-2.16-8core-4096")
|
| 85 |
|
| 86 |
from transformers import AutoTokenizer
|
|
|
|
| 80 |
#num_cores should be changed based on the instance. inf2.24xlarge has 6 neuron processors (they have two cores each) so 12 total
|
| 81 |
input_shapes = {"batch_size": 1, "sequence_length": 4096}
|
| 82 |
compiler_args = {"num_cores": 8, "auto_cast_type": 'fp16'}
|
| 83 |
+
model = NeuronModelForCausalLM.from_pretrained("upstage/SOLAR-10.7B-v1.0", export=True, **compiler_args, **input_shapes)
|
| 84 |
model.save_pretrained("SOLAR-10.7B-v1.0-neuron-24xlarge-2.16-8core-4096")
|
| 85 |
|
| 86 |
from transformers import AutoTokenizer
|