dolly-v2-12b / app.py
beratcmn
Added model
fb1c9eb
raw
history blame contribute delete
374 Bytes
import gradio as gr
import torch
from transformers import pipeline
generate_text = pipeline(
model="databricks/dolly-v2-12b",
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
def text_generation(prompt: str):
return generate_text(prompt)
iface = gr.Interface(fn=text_generation, inputs="text", outputs="text")
iface.launch()