Instructions to use Jotschi/Mistral-7B-v0.1-coco-caption-de with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jotschi/Mistral-7B-v0.1-coco-caption-de with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jotschi/Mistral-7B-v0.1-coco-caption-de")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jotschi/Mistral-7B-v0.1-coco-caption-de") model = AutoModelForCausalLM.from_pretrained("Jotschi/Mistral-7B-v0.1-coco-caption-de") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Jotschi/Mistral-7B-v0.1-coco-caption-de with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jotschi/Mistral-7B-v0.1-coco-caption-de" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jotschi/Mistral-7B-v0.1-coco-caption-de", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jotschi/Mistral-7B-v0.1-coco-caption-de
- SGLang
How to use Jotschi/Mistral-7B-v0.1-coco-caption-de 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 "Jotschi/Mistral-7B-v0.1-coco-caption-de" \ --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": "Jotschi/Mistral-7B-v0.1-coco-caption-de", "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 "Jotschi/Mistral-7B-v0.1-coco-caption-de" \ --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": "Jotschi/Mistral-7B-v0.1-coco-caption-de", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jotschi/Mistral-7B-v0.1-coco-caption-de with Docker Model Runner:
docker model run hf.co/Jotschi/Mistral-7B-v0.1-coco-caption-de
Model Card for Mistral7B-v0.1-coco-caption-de
This model is a fine-tuned model of the Mistral7B-v0.1 completion model and meant to produce german COCO like captions.
The coco-karpathy-opus-de dataset was used to tune the model for german image caption generation.
Model Details
Prompt format
The completion model is trained with the prompt prefix Bildbeschreibung:
Examples:
>>> Bildbeschreibung:
2 Hunde sitzen auf einer Bank neben einer Pflanze
>>> Bildbeschreibung: Wasser
fall und Felsen vor dem Gebäude mit Blick auf den Fluss.
>>> Bildbeschreibung: Ein grünes Auto mit roten
Reflektoren parkte auf dem Parkplatz.
Model Description
- Developed by: Jotschi
- License: Apache License
- Finetuned from model: Mistral7B-v0.1
Uses
The model is meant to be used in conjunction with a BLIP2 Q-Former to enable image captioning, visual question answering (VQA) and chat-like conversations.
Training Details
The preliminary training script uses PEFT and DeepSpeed to execute the traininng.
Training Data
Training Procedure
The model was trained using PEFT 4Bit Q-LoRA with the following parameters:
- rank: 256
- alpha: 16
- steps: 8500
- bf16: True
- lr_scheduler_type: cosine
- warmup_ratio: 0.03
- gradient accumulation steps: 2
- batch size: 4
- Input sequence length: 512
- Learning Rate: 2.0e-5
Postprocessing
The merged model was saved using PeftModel API.
Framework versions
- PEFT 0.8.2
- Downloads last month
- 1