try_slm / app.py
lljz66's picture
Remove @spaces.GPU, CPU-only
55d9b15 verified
Raw
History Blame Contribute Delete
541 Bytes
import gradio as gr
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="LiquidAI/LFM2.5-230M-GGUF",
filename="LFM2.5-230M-Q4_K_M.gguf",
)
def chat(message, history):
prompt = f"<|user|>\n{message}\n<|assistant|>\n"
output = llm(
prompt,
max_tokens=256,
temperature=0.7,
stop=["<|user>", "<|end|>"],
)
return output["choices"][0]["text"].strip()
gr.ChatInterface(
chat,
title="Try SLM - LFM2.5 230M",
description="LiquidAI LFM2.5-230M GGUF model"
).launch()