nbroad HF staff commited on
Commit
9197efd
1 Parent(s): 501a136

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a pipeline as a high-level helper
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("text-generation", model="ibm-granite/granite-8b-code-instruct", device=0)
5
+
6
+
7
+ import gradio as gr
8
+
9
+ def prompt_model(prompt):
10
+ return pipe(prompt)
11
+
12
+ demo = gr.Interface(fn=prompt_model, inputs="textbox", outputs="textbox")