File size: 491 Bytes
854be63
 
 
 
 
 
 
3e852bc
854be63
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import torch
from transformers import pipeline

title = "Text Generator"
description = "This text generator has been trained to chat and to respond to natural language instructions."

ans = pipeline(model="databricks/dolly-v2-3", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")

def answer(query):
    out = ans(query)
    return out

Demo = gr.Interface(fn=answer, inputs='text', outputs='text', title=title, description=description)
Demo.launch()