File size: 451 Bytes
838377c
74d5309
f90a23d
25cbcb4
74d5309
25cbcb4
 
 
f90a23d
838377c
74d5309
 
f90a23d
74d5309
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from llama_cpp import Llama
import gradio as gr

llm = Llama(
    model_path="https://huggingface.co/bartowski/MegaBeam-Mistral-7B-512k-GGUF/resolve/main/MegaBeam-Mistral-7B-512k-Q4_K_M.gguf",
    n_ctx=8192,
    n_threads=4
)

def chat(prompt):
    output = llm(prompt, max_tokens=512, temperature=0.7)
    return output["choices"][0]["text"]

gr.Interface(fn=chat, inputs="text", outputs="text", title="🧠 MegaBeam Mistral 512k Chatbot").launch()