Encyclopedia Autonomica

Encyclopedia Autonomica

Saturday Code Snippet

Building a simple chatbot with Mistral-7B-Instruct-v0.2

Jan Daniel Semrau (MFin, CAIO)'s avatar
Jan Daniel Semrau (MFin, CAIO)
Apr 13, 2024
∙ Paid
Share

I wanted to play around with the new Mistral model but had to realize that the default script didn’t run on my 6 GPU setup.

So here you go.

A simple script that works (at least for now)

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch, os, time

os.environ["PYTORCH_CUDA_ALLOC_CONF"]="expandable_segments:True"
os.environ["PYTORCH_C…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 JDS
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture