shams1992 commited on
Commit
4085164
·
1 Parent(s): 5c252bd

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-3b", 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 Afghanistan ?']])
9
+ Demo.launch()