import gradio as gr from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="HackNetAyush/smollm2-135M-instruct-gguf-q8", filename="smollm2-135m-instruct-q8_0.gguf", n_ctx=8192, n_batch=1024, n_threads=2, verbose=False, ) def chat(message, history): response = llm.create_chat_completion( messages=[{"role": "user", "content": message}] ) return response["choices"][0]["message"]["content"] gr.ChatInterface(fn=chat).launch()