Spaces:
Running
Running
| import gradio as gr | |
| from llama_cpp import Llama | |
| llm = Llama( | |
| model_path="deepseek-coder-6.7b.Q4_K_M.gguf", | |
| n_ctx=2048, | |
| n_threads=4 | |
| ) | |
| def chat(prompt): | |
| system_prompt = "You are a helpful coding assistant. Answer precisely." | |
| full_prompt = f"### Instruction:\n{prompt}\n### Response:\n" | |
| output = llm(full_prompt, max_tokens=1024) | |
| return output["choices"][0]["text"] | |
| gr.Interface( | |
| fn=chat, | |
| inputs="text", | |
| outputs="text", | |
| title="DeepSeek Coder 6.7B", | |
| description="Free ChatGPT-style coding assistant", | |
| theme="soft" | |
| ).launch() | |