madansa7 commited on
Commit
da47371
·
verified ·
1 Parent(s): 0ba8733

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline(
5
+ "text-generation",
6
+ model="agentica-org/DeepCoder-14B-Preview",
7
+ device="cuda"
8
+ )
9
+
10
+ def chat(message, history):
11
+ messages = [{"role": "user", "content": message}]
12
+ response = pipe(messages)
13
+ return response[0]["generated_text"]
14
+
15
+ gr.ChatInterface(chat).launch()