Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Load a free coding model
|
| 5 |
+
generator = pipeline("text-generation", model="deepseek-ai/deepseek-coder-6.7b-instruct")
|
| 6 |
+
|
| 7 |
+
def code_assistant(prompt):
|
| 8 |
+
response = generator(prompt, max_length=512, do_sample=True, temperature=0.2)
|
| 9 |
+
return response[0]['generated_text']
|
| 10 |
+
|
| 11 |
+
iface = gr.Interface(fn=code_assistant, inputs="text", outputs="text", title="Daxtin AI Coder")
|
| 12 |
+
iface.launch()
|