sudhir2016 commited on
Commit
2551380
Β·
1 Parent(s): a3a3ccc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import torch
3
+ from transformers import pipeline
4
+ ans = pipeline(model="databricks/dolly-v2-2-8b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
5
+ def answer(query):
6
+ out=ans(query)
7
+ return out
8
+ Demo = gr.Interface(fn=answer,inputs='text',outputs='text',examples=[['What is the capital of India ?']])
9
+ Demo.launch()