gradio-dolly2 / app.py
kevinbednarek's picture
Update app.py
4095cc1
raw
history blame
380 Bytes
%pip install accelerate>=0.12.0 transformers[torch]==4.25.1
%pip install gradio
import torch
import gradio as gr
from transformers import pipeline
generate_text = pipeline(model="databricks/dolly-v2-3b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
interface = gr.Interface(fn=generate_text, inputs='text', outputs='text')
interface.launch(share=True)