Instructions to use SciPhi/Sensei-7B-V1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SciPhi/Sensei-7B-V1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SciPhi/Sensei-7B-V1")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SciPhi/Sensei-7B-V1") model = AutoModelForCausalLM.from_pretrained("SciPhi/Sensei-7B-V1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SciPhi/Sensei-7B-V1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SciPhi/Sensei-7B-V1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SciPhi/Sensei-7B-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SciPhi/Sensei-7B-V1
- SGLang
How to use SciPhi/Sensei-7B-V1 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 "SciPhi/Sensei-7B-V1" \ --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": "SciPhi/Sensei-7B-V1", "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 "SciPhi/Sensei-7B-V1" \ --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": "SciPhi/Sensei-7B-V1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SciPhi/Sensei-7B-V1 with Docker Model Runner:
docker model run hf.co/SciPhi/Sensei-7B-V1
template format
the template for the model is:
Instruction:
Your task is to perform retrieval augmented generation (RAG) over the given query and search results. Return your answer in a json format that includes a summary of the search results and a list of related queries.
Query:
{prompt}
\n\n
Search Results:
{context}
\n\n
Query:
{prompt}
Response:
{"summary":
that means that query/prompt has to be repeated? or i'm missing something.
thanks, great work!
query is repeated as the attention mechanism appears to benefit from repeating - see Google's recent Fresh LLMs.
I think this is not limited to the attention mechanism, I use RWKV model (RNN-based) and the community put the question at the beginning and at the end of the prompt for such context based QA task, otherwise it forgets sometimes what the question was
@cahya RWKV is a bit different, is a strict RNN and does not have attention. It cant "look" backwards.
@emrgnt-cmplxty Not sure what you are referring to but I guess that you have measured it. DO you apply the same strategy in the training dataset?