Instructions to use Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ") model = AutoModelForCausalLM.from_pretrained("Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ
- SGLang
How to use Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ 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 "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ" \ --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": "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ", "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 "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ" \ --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": "Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ with Docker Model Runner:
docker model run hf.co/Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ
Serverless GPUs to scale your machine learning inference without any hassle of managing servers, deploy complicated and custom models with ease.
Go through this tutorial, for quickly deploy SOLAR-10.7B-Instruct-v1.0 using Inferless
SOLAR-10.7B-Instruct-v1.0 - GPTQ
- Model creator: Upstage
- Original model: SOLAR-10.7B-Instruct-v1.0
Description
This repo contains GPTQ model files for Upstage's SOLAR-10.7B-Instruct-v1.0.
About GPTQ
GPTQ is a method that compresses the model size and accelerates inference by quantizing weights based on a calibration dataset, aiming to minimize mean squared error in a single post-quantization step. GPTQ achieves both memory efficiency and faster inference.
It is supported by:
- Text Generation Webui - using Loader: AutoAWQ
- vLLM - version 0.2.2 or later for support for all model types.
- Hugging Face Text Generation Inference (TGI)
- Transformers version 4.35.0 and later, from any code or client that supports Transformers
- AutoAWQ - for use from Python code
Shared files, and GPTQ parameters
Models are released as sharded safetensors files.
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|---|---|---|---|---|---|
| main | 4 | 128 | VMware Open Instruct | 4096 | 5.96 GB |
How to use
You will need the following software packages and python libraries:
build:
cuda_version: "12.1.1"
system_packages:
- "libssl-dev"
python_packages:
- "torch==2.1.2"
- "vllm==0.2.6"
- "transformers==4.36.2"
- "accelerate==0.25.0"
Here is the code for app.py
from vllm import LLM, SamplingParams
class InferlessPythonModel:
def initialize(self):
self.sampling_params = SamplingParams(temperature=0.7, top_p=0.95,max_tokens=256)
self.llm = LLM(model="Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ", quantization="gptq", dtype="float16")
def infer(self, inputs):
prompts = inputs["prompt"]
result = self.llm.generate(prompts, self.sampling_params)
result_output = [[[output.outputs[0].text,output.outputs[0].token_ids] for output in result]
return {'generated_result': result_output[0]}
def finalize(self):
pass
- Downloads last month
- 4
Model tree for Inferless/SOLAR-10.7B-Instruct-v1.0-GPTQ
Base model
upstage/SOLAR-10.7B-v1.0