Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from llama_cpp import Llama
|
| 3 |
|
| 4 |
-
llm = Llama(model_path="model.gguf", n_ctx=
|
| 5 |
|
| 6 |
-
def generate(message, history,temperature=0.
|
| 7 |
-
system_prompt = "You are
|
| 8 |
formatted_prompt = [{"role": "system", "content": system_prompt}]
|
| 9 |
for user_prompt, bot_response in history:
|
| 10 |
formatted_prompt.append({"role": "user", "content": user_prompt})
|
|
@@ -20,7 +20,7 @@ def generate(message, history,temperature=0.3,max_tokens=512):
|
|
| 20 |
mychatbot = gr.Chatbot(
|
| 21 |
avatar_images=["user.png", "bots.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
| 22 |
|
| 23 |
-
iface = gr.ChatInterface(fn=generate, chatbot=mychatbot, retry_btn=
|
| 24 |
|
| 25 |
with gr.Blocks() as demo:
|
| 26 |
gr.HTML("<center><h1>Tomoniai's Chat with Nous Hermes 2 Solar</h1></center>")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from llama_cpp import Llama
|
| 3 |
|
| 4 |
+
llm = Llama(model_path="model.gguf", n_ctx=8192, n_threads=4, chat_format="chatml")
|
| 5 |
|
| 6 |
+
def generate(message, history,temperature=0.75,max_tokens=768):
|
| 7 |
+
system_prompt = "You are a helpful and agreeable chat-bot named Solar. You are capable of Replying with Lightning fast speeds."
|
| 8 |
formatted_prompt = [{"role": "system", "content": system_prompt}]
|
| 9 |
for user_prompt, bot_response in history:
|
| 10 |
formatted_prompt.append({"role": "user", "content": user_prompt})
|
|
|
|
| 20 |
mychatbot = gr.Chatbot(
|
| 21 |
avatar_images=["user.png", "bots.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
|
| 22 |
|
| 23 |
+
iface = gr.ChatInterface(fn=generate, chatbot=mychatbot, retry_btn="Retry", undo_btn="Undo")
|
| 24 |
|
| 25 |
with gr.Blocks() as demo:
|
| 26 |
gr.HTML("<center><h1>Tomoniai's Chat with Nous Hermes 2 Solar</h1></center>")
|