Spaces:
No application file
No application file
| import gradio as gr | |
| from llama_cpp import Llama | |
| # β Update with your actual model path | |
| model_path = r"C:\Users\razaa\.cache\lm-studio\models\lmstudio-community\DeepSeek-R1-Distill-Llama-8B-GGUF\DeepSeek-R1-Distill-Llama-8B-Q4_K_M.gguf" | |
| # β Load the model | |
| llm = Llama(model_path=model_path, n_ctx=2048) | |
| # β Function to generate responses | |
| def generate_response(prompt): | |
| response = llm(prompt, max_tokens=256, temperature=0.7, top_p=0.9) | |
| return response['choices'][0]['text'] | |
| # β Create Gradio UI | |
| demo = gr.Interface(fn=generate_response, inputs="text", outputs="text") | |
| # β Make it accessible from the internet | |
| demo.launch(share=True) | |