File size: 558 Bytes
a34378f 45f49e9 a34378f 45f49e9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import gradio as gr
import torch
import json
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("keminglu/pivoine-7b", use_auth_token="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", padding_side="left")
model = AutoModelForCausalLM.from_pretrained("keminglu/pivoine-7b", use_auth_token="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", torch_dtype=torch.float16)
#input_device = torch.device("cuda:5")
model.requires_grad_(False)
model.eval()
#model = model.to(input_device)
# examples = json.load(open("examples.json")) |