kevinbednarek commited on
Commit
fc9a365
β€’
1 Parent(s): d808ae7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ! pip install accelerate>=0.12.0 transformers[torch]==4.25.1
2
+ ! pip install gradio
3
+
4
+ import torch
5
+ import gradio as gr
6
+ from transformers import pipeline
7
+
8
+ generate_text = pipeline(model="databricks/dolly-v2-3b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
9
+
10
+ interface = gr.Interface(fn=generate_text, inputs='text', outputs='text')
11
+ interface.launch(share=True)