Instructions to use gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1") model = AutoModelForCausalLM.from_pretrained("gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1") 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 gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1
- SGLang
How to use gerasmark/Mistral-7B-Instruct-v0.3-Forensics-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 "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1" \ --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": "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1", "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 "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1" \ --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": "gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1 with Docker Model Runner:
docker model run hf.co/gerasmark/Mistral-7B-Instruct-v0.3-Forensics-v1
Summary
This model is a fine-tuned version of the Mistral-7B-Instruct-v0.3 optimised for answering questions in the domain of forensic investigations. The model has been trained using a specialised dataset titled Advanced_Forensic_Investigations_Knowledge_Library_v1, which consists of approximately 100 domain-specific question-answer pairs. The objective is to support advanced forensic investigative reasoning, rapid knowledge retrieval, and high-precision forensic domain assistance.
Model Details
Model Description
Model type: Instruction-following Language Model (LoRA-based fine-tuning)
Language(s): English
Fine-tuned from model: Mistral-7B-Instruct-v0.3
Training Details
Training Data
Dataset:
Advanced_Forensic_Investigations_Knowledge_Library_v1Data size: ~100 high-quality, domain-specific QA pairs
Training Procedure
Preprocessing
Template:
mistralToken truncation/cutoff: 2048
No vocab resizing or prompt packing
Hyperparameters
Finetuning type: LoRA
Precision:
bf16LoRA rank: 16
LoRA alpha: 32
Batch size: 4
Gradient accumulation: 8
Learning rate:
3e-4Epochs: 35
LR scheduler: cosine
Quantisation: 4-bit (bitsandbytes)
Cutoff length: 2048
Compute
Training time: close to 30 minutes
Framework: LLaMA-Factory
Evaluation
Testing Data, Factors & Metrics
Metrics Used: BLEU-4, ROUGE-1, ROUGE-2
Results:
BLEU-4: 100%
ROUGE-1: 100%
ROUGE-2: 100%
These scores reflect perfect overlap with reference answers within the scope of the evaluation dataset.
Technical Specifications
Model Architecture and Objective
Base: Transformer (Mistral-7B architecture)
Fine-tuning method: LoRA
Objective: Instruction-following with forensic legal knowledge adaptation
Compute Infrastructure
Hardware: 2xL40s
Software: LLaMA-Factory, PyTorch, Transformers, bitsandbytes
- Downloads last month
- 5