GPT_QUEEN / app.py
Bhaddy392's picture
Update app.py
0663f25 verified
raw
history blame contribute delete
392 Bytes
import gradio as gr
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="TheBloke/TinyLlama-1.1B-GGUF",
filename="tinyllama-1.1b.Q4_K_M.gguf"
)
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()