Instructions to use rootsec1/mistral-7B-it-aipi with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rootsec1/mistral-7B-it-aipi with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rootsec1/mistral-7B-it-aipi") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rootsec1/mistral-7B-it-aipi") model = AutoModelForCausalLM.from_pretrained("rootsec1/mistral-7B-it-aipi") 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
- vLLM
How to use rootsec1/mistral-7B-it-aipi with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rootsec1/mistral-7B-it-aipi" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rootsec1/mistral-7B-it-aipi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rootsec1/mistral-7B-it-aipi
- SGLang
How to use rootsec1/mistral-7B-it-aipi 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 "rootsec1/mistral-7B-it-aipi" \ --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": "rootsec1/mistral-7B-it-aipi", "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 "rootsec1/mistral-7B-it-aipi" \ --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": "rootsec1/mistral-7B-it-aipi", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rootsec1/mistral-7B-it-aipi with Docker Model Runner:
docker model run hf.co/rootsec1/mistral-7B-it-aipi
Fine-tuning Mistral-7B-v0.1 on Symbolic Instruction Tuning Dataset
This repository contains the fine-tuned version of the mistralai/Mistral-7B-v0.1 model on the sail/symbolic-instruction-tuning dataset. The objective of this fine-tuning process is to specialize the pre-trained model for improved performance on tasks that require understanding and processing symbolic instructions.
Model Description
Mistral-7B-v0.1 is a transformer-based language model pre-trained on a diverse corpus of text. Our fine-tuning process aims to leverage this pre-trained model and further optimize it for the symbolic instruction tuning task provided by the sail/symbolic-instruction-tuning dataset.
Dataset
The sail/symbolic-instruction-tuning dataset is designed to test a model's ability to comprehend and execute symbolic instructions. It consists of a series of tasks that require the model to manipulate symbolic inputs according to specific instructions.
Fine-tuning Process
The fine-tuning process involves the following steps:
Environment Setup: Ensure that your environment has all the necessary dependencies installed, including
transformersanddatasetsfrom Hugging Face.Data Preparation: Load the
sail/symbolic-instruction-tuningdataset using thedatasetslibrary and prepare it for the training process, including any necessary preprocessing steps.Model Initialization: Load the pre-trained
mistralai/Mistral-7B-v0.1model and prepare it for fine-tuning.Training: Fine-tune the model on the prepared dataset using an appropriate training script. This involves setting hyperparameters, training loops, and logging.
Evaluation: Evaluate the fine-tuned model's performance on a validation set to ensure that it has learned the task effectively.
Saving and Sharing: Save the fine-tuned model and upload it to the Hugging Face model hub for easy sharing and reuse.
Usage
The fine-tuned model can be loaded from the Hugging Face model hub using the transformers library as follows:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "rootsec1/mistal-7B-it-aipi"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Example usage
inputs = tokenizer("Example input", return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 1