Instructions to use letxbe/mistral-7b-v03-BoundingDocs-rephrased with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use letxbe/mistral-7b-v03-BoundingDocs-rephrased with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="letxbe/mistral-7b-v03-BoundingDocs-rephrased")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased") model = AutoModelForCausalLM.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use letxbe/mistral-7b-v03-BoundingDocs-rephrased with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "letxbe/mistral-7b-v03-BoundingDocs-rephrased" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "letxbe/mistral-7b-v03-BoundingDocs-rephrased", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/letxbe/mistral-7b-v03-BoundingDocs-rephrased
- SGLang
How to use letxbe/mistral-7b-v03-BoundingDocs-rephrased 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 "letxbe/mistral-7b-v03-BoundingDocs-rephrased" \ --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": "letxbe/mistral-7b-v03-BoundingDocs-rephrased", "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 "letxbe/mistral-7b-v03-BoundingDocs-rephrased" \ --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": "letxbe/mistral-7b-v03-BoundingDocs-rephrased", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use letxbe/mistral-7b-v03-BoundingDocs-rephrased with Docker Model Runner:
docker model run hf.co/letxbe/mistral-7b-v03-BoundingDocs-rephrased
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased")
model = AutoModelForCausalLM.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased", device_map="auto")Quick Links
Model Card for letxbe/mistral-7b-v03-BoundingDocs-rephrased
letxbe/mistral-7b-v03-BoundingDocs-rephrased is a fine-tuned Mistral-7B-v0.3 for the Document Question Answering task. It was trained on BoundingDocs using the rephrased version of the questions.
Model Details
Model Description
- Developed by: LetXBe
- Model Type: LLM
- Languages: Multilingual
- License: CC BY 4.0
- Finetuned From:
Mistral-7B-v0.3 - Input Format: Text using custom prompt
- Output Format: JSON
π How to Use
Prompt
The model should be prompted with this prompt:
TEMPLATE_PROMPT = '''<|startdocument|>
{DOCUMENT}
<|enddocument|>
<|starttask|>
Answer the following question about the document:
Question: "{QUESTION}"
Answer completing the following format:
'''json
{"value": ""}
'''
<|endtask|>
'''
where DOCUMENT is the textual content of the document page.
Inference Example
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased")
model = AutoModelForCausalLM.from_pretrained("letxbe/mistral-7b-v03-BoundingDocs-rephrased")
# Encode input
input_text = "Your prompt"
inputs = tokenizer(input_text, return_tensors="pt")
# Generate response
outputs = model.generate(**inputs)
# Decode and print
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
- Downloads last month
- 13
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="letxbe/mistral-7b-v03-BoundingDocs-rephrased")