Instructions to use Guibibo/Mistral-7B-v0.3-FlashCards with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Guibibo/Mistral-7B-v0.3-FlashCards with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3") model = PeftModel.from_pretrained(base_model, "Guibibo/Mistral-7B-v0.3-FlashCards") - Transformers
How to use Guibibo/Mistral-7B-v0.3-FlashCards with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Guibibo/Mistral-7B-v0.3-FlashCards") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Guibibo/Mistral-7B-v0.3-FlashCards", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Guibibo/Mistral-7B-v0.3-FlashCards with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Guibibo/Mistral-7B-v0.3-FlashCards" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Guibibo/Mistral-7B-v0.3-FlashCards", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Guibibo/Mistral-7B-v0.3-FlashCards
- SGLang
How to use Guibibo/Mistral-7B-v0.3-FlashCards 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 "Guibibo/Mistral-7B-v0.3-FlashCards" \ --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": "Guibibo/Mistral-7B-v0.3-FlashCards", "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 "Guibibo/Mistral-7B-v0.3-FlashCards" \ --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": "Guibibo/Mistral-7B-v0.3-FlashCards", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Guibibo/Mistral-7B-v0.3-FlashCards with Docker Model Runner:
docker model run hf.co/Guibibo/Mistral-7B-v0.3-FlashCards
Model Card for Model ID
This model creates Anki Flashcards from french texts.
Model Details
Model Description
This model takes as input chunks of texts and outputs flashcards in the format'Q: A:'. It was trained on a personal dataset of french cards.
- Developed by: Guillaume Bertho
- Language(s) (NLP): French
- Finetuned from model Mistral-7B-Instruct-v0.3
Model Sources [optional]
- Repository: https://github.com/GUIBOoO/ankify-local
Uses
Give the model chunks of french text (from 100 to 2000 tokens). This model doesn't perform well on mathematical expressions/
Bias, Risks, and Limitations
This model can sometimes generate non-self-contained cards.
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
How to Get Started with the Model
Use the code below to get started with the model.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
MODEL_NAME = "Guibibo/Mistral-7B-v0.3-FlashCards"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
torch_dtype=torch.float16,
device_map="auto" # automatically uses GPU if available
)
prompt = """Victor Hugo, né le 7 ventôse an X (26 février 1802) à Besançon ..."""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=100, # adjust length
do_sample=True,
temperature=0.7,
top_p=0.9
)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("=== Generated Text ===")
print(generated_text)
Training Details
Training Data
Personal data. I will maybe upload the dataset later.
Training Hyperparameters
Training settings : Warmup ratio: 0.03 Gradient accumulation steps: 4 Learning rate: 1e-4 Number of epochs: 1 Learning rate scheduler: cosine Weight decay: 0.01 Mixed precision training enabled (fp16)
LoRA configuration: Rank (r): 64 LoRA alpha: 64 LoRA dropout: 0.05 Target modules: ["q_proj", "v_proj"] Task type: CAUSAL_LM
Tokenizer settings: Pad sequences to end-of-sequence (pad_to_eos: true)
- PEFT 0.18.0
- Downloads last month
- 4
Model tree for Guibibo/Mistral-7B-v0.3-FlashCards
Base model
mistralai/Mistral-7B-v0.3