import gradio as gr | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
tokenizer = AutoTokenizer.from_pretrained("bigscience/bloom") | |
model = AutoModelForCausalLM.from_pretrained( | |
"bigscience/bloom", | |
device_map="auto", | |
torch_dtype="auto", | |
) | |
def greet(name): | |
return "Hello " + name + "!!" | |
iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
iface.launch() | |