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