space_face / app.py
pragmatic-lunatic's picture
Create app.py
0eb9e5f verified
raw
history blame contribute delete
286 Bytes
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "ibm-granite/granite-7b-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
# Codice per eseguire inferenze con il modello