File size: 398 Bytes
88b5c49
fbe83b1
 
d697806
 
57b6c4f
 
88b5c49
fbe83b1
d697806
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from llama_cpp import Llama
import gradio as gr

model = Llama(
    model_path="qwen2.5-1.5B-q4.gguf",
    n_ctx=4096,
    n_gpu_layers=0,
)

def chat(prompt):
    out = model(
        prompt,
        max_tokens=256,
        temperature=0.7,
    )
    return out["choices"][0]["text"]

gr.Interface(
    fn=chat,
    inputs="text",
    outputs="text",
    title="Qwen2.5-1.5B Q4 Chatbot"
).launch()