from outlines import models | |
from gigax.step import NPCStepper | |
# Download model from the Hub | |
model_name = "Gigax/NPC-LLM-7B" | |
llm = AutoModelForCausalLM.from_pretrained(model_name) | |
tokenizer = AutoTokenizer.from_pretrained(model_name) | |
# Our stepper takes in a Outlines model to enable guided generation | |
# This forces the model to follow our output format | |
model = models.Transformers(llm, tokenizer) | |
# Instantiate a stepper: handles prompting + output parsing | |
stepper = NPCStepper(model=model) | |