SALEETAI/Coding-Agent
0
1import gradio as gr2from llama_cpp import Llama3import os4 5# Path is now local because we downloaded it in Dockerfile6model_path = "/app/coding-agent-qwen-sft-v3-GGUF.q4_k_m.gguf"7 8print(f"Checking for model at {model_path}...")9if not os.path.exists(model_path):10 print("MODEL NOT FOUND!")11 12llm = Llama(model_path=model_path, n_ctx=2048)13 14def generate(prompt):15 output = llm(16 f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n",17 max_tokens=1024,18 stop=["<|im_end|>"],19 repeat_penalty=1.2,20 temperature=0.421 )22 return output['choices'][0]['text']23 24gr.ChatInterface(generate).launch(server_name="0.0.0.0", server_port=7860)25 