File size: 420 Bytes
32b0450
59c9e49
 
e713002
59c9e49
 
32b0450
59c9e49
 
 
1
2
3
4
5
6
7
8
9
10
import gradio as gr
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

tokenizer = AutoTokenizer.from_pretrained("jslin09/bloom-560m-finetuned-fraud")
model = AutoModelForCausalLM.from_pretrained("jslin09/bloom-560m-finetuned-fraud")

def predict(input, history=[]):
    # tokenize the new input sentence
    new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')