Falcon-Bot / app.py
kingabzpro's picture
Update app.py
bc94487
raw
history blame
403 Bytes
from transformers import AutoTokenizer
import gradio as gr
import transformers
import torch
model = "tiiuae/falcon-rw-1b"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
gr.Interface.from_pipeline(pipeline).launch()