Instructions to use SuperAGI/mistral-7B-PoSE-32k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SuperAGI/mistral-7B-PoSE-32k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SuperAGI/mistral-7B-PoSE-32k")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SuperAGI/mistral-7B-PoSE-32k") model = AutoModelForCausalLM.from_pretrained("SuperAGI/mistral-7B-PoSE-32k") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SuperAGI/mistral-7B-PoSE-32k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SuperAGI/mistral-7B-PoSE-32k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SuperAGI/mistral-7B-PoSE-32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SuperAGI/mistral-7B-PoSE-32k
- SGLang
How to use SuperAGI/mistral-7B-PoSE-32k 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 "SuperAGI/mistral-7B-PoSE-32k" \ --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": "SuperAGI/mistral-7B-PoSE-32k", "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 "SuperAGI/mistral-7B-PoSE-32k" \ --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": "SuperAGI/mistral-7B-PoSE-32k", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SuperAGI/mistral-7B-PoSE-32k with Docker Model Runner:
docker model run hf.co/SuperAGI/mistral-7B-PoSE-32k
Model Card for Mistral-7B-32K-PoSE
The Mistral-7B-32K-PoSE Large Language Model (LLM) is a PoSE trained Mistral 7B for 32k context length. The PoSE technique of extending the context length of Mistral-7B outperforms the passkey retrieval task with only a marginal impact on the standard benchmarks.
For full details of this model please read our release blog post.
Results
PassKey retrieval
The evaluation focuses on their effectiveness in passkey retrieval, highlighting the impact of varying context lengths on the models ability to extract crucial information. Our model excels in information extraction, capable of handling context lengths up to 32k, surpassing the limitations of the original Mistral7B model which could pass the test cases only if the context window was under 8k.
Standard Benchmarking
Our model achieves an extension to 32k while only experiencing a marginal impact on the standard benchmark accuracy. This demonstrates a commendable ability to handle longer contexts without significantly compromising overall performance.
Run the model
from transformers import AutoTokenizer
from my_modeling_mistral import MistralForCausalLM
model_id = "SuperAGI/mistral-7B-PoSE-32k"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = MistralForCausalLM.from_pretrained(model_id)
text = "Hello my name is"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Limitations
The Mistral-7B-32K-PoSE model is a demonstration that the context length can be extended without losing much on the performance. It does not have any moderation mechanisms. The model is not suitable for production usage as it doesn't have guardrails for toxicity, societal bias, and language limitations. We would love to collaborate with the community to build safer and better models.
The SuperAGI AI Team
Ishaan Bhola, Mukunda NS, Rajat Chawla, Anmol Gautam, Arkajit Datta, Ayush Vatsal, Sukrit Chatterjee, Adarsh Jha, Adarsh Deep, Abhijeet Sinha, Rakesh Krishna.
- Downloads last month
- 30