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

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…
User's avatar

Continue reading this post for free, courtesy of Jan Daniel Semrau (MFin, CAIO).

Or purchase a paid subscription.
© 2025 JDS · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture