Instructions to use Intel/neural-chat-7b-v1-1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Intel/neural-chat-7b-v1-1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Intel/neural-chat-7b-v1-1", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Intel/neural-chat-7b-v1-1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Intel/neural-chat-7b-v1-1", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Intel/neural-chat-7b-v1-1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Intel/neural-chat-7b-v1-1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Intel/neural-chat-7b-v1-1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Intel/neural-chat-7b-v1-1
- SGLang
How to use Intel/neural-chat-7b-v1-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 "Intel/neural-chat-7b-v1-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": "Intel/neural-chat-7b-v1-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 "Intel/neural-chat-7b-v1-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": "Intel/neural-chat-7b-v1-1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Intel/neural-chat-7b-v1-1 with Docker Model Runner:
docker model run hf.co/Intel/neural-chat-7b-v1-1
Error load Model
!pip install intel-extension-for-transformers
from transformers import AutoTokenizer, TextStreamer
from intel_extension_for_transformers.transformers import AutoModelForCausalLM
model_name = "Intel/neural-chat-7b-v1-1" # Hugging Face model_id or local model
prompt = "Once upon a time, there existed a little girl,"
tokenizer = AutoTokenizer.from_pretrained(model_name,
trust_remote_code=True)
inputs = tokenizer(prompt, return_tensors="pt").input_ids
streamer = TextStreamer(tokenizer)
model = AutoModelForCausalLM.from_pretrained(model_name,
load_in_8bit=True,
trust_remote_code=True)
outputs = model.generate(inputs, streamer=streamer, max_new_tokens=300)
Error:
!pip install git+"https://github.com/HazyResearch/flash-attention.git#subdirectory=csrc/layer_norm"
Thanks for your usage, but from the log you provided, we found that the error happened in this project https://github.com/togethercomputer/stripedhyena, not related to ours project.
I will recommend you to go through following suggestions to fix the error for "togethercomputer/stripedhyena"
There are two solutions for second pip install error
1. Make sure the env is installed Microsoft Visual C++ Build Tools or MinGW-w64 for windows, GCC and cmake for Linux . Therefore the build process for flash-attention may successfully.
2. Install flash-attention through pre build binary rather than build in time
After solve second error and successfully install flash-attention, the first import module error should be solved at same time.

