Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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()
|