Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ quant = os.getenv('QUANT')
|
|
9 |
chat_template = os.getenv('CHAT_TEMPLATE')
|
10 |
|
11 |
# Interface variables
|
12 |
-
model_name = model_id.split('/')[1]
|
13 |
title = f"🇩🇪 {model_name}"
|
14 |
description = f"Chat with <a href=\"https://huggingface.co/{model_id}\">{model_name}</a> in GGUF format ({quant})!"
|
15 |
|
@@ -21,7 +21,8 @@ llm = Llama(model_path="model.gguf",
|
|
21 |
|
22 |
# Function for streaming chat completions
|
23 |
def chat_stream_completion(message, history, system_prompt):
|
24 |
-
messages_prompts = [{"role": "system", "content": system_prompt}]
|
|
|
25 |
for human, assistant in history:
|
26 |
messages_prompts.append({"role": "user", "content": human})
|
27 |
messages_prompts.append({"role": "assistant", "content": assistant})
|
@@ -43,8 +44,8 @@ gr.ChatInterface(
|
|
43 |
fn=chat_stream_completion,
|
44 |
title=title,
|
45 |
description=description,
|
46 |
-
additional_inputs=[gr.Textbox("Du bist ein hilfreicher Assistent.")],
|
47 |
-
additional_inputs_accordion="📝 System prompt",
|
48 |
examples=[
|
49 |
["Was ist ein Large Language Model?"],
|
50 |
["Was ist 9+2-1?"],
|
|
|
9 |
chat_template = os.getenv('CHAT_TEMPLATE')
|
10 |
|
11 |
# Interface variables
|
12 |
+
model_name = model_id.split('/')[-1]
|
13 |
title = f"🇩🇪 {model_name}"
|
14 |
description = f"Chat with <a href=\"https://huggingface.co/{model_id}\">{model_name}</a> in GGUF format ({quant})!"
|
15 |
|
|
|
21 |
|
22 |
# Function for streaming chat completions
|
23 |
def chat_stream_completion(message, history, system_prompt):
|
24 |
+
#messages_prompts = [{"role": "system", "content": system_prompt}]
|
25 |
+
messages_prompts = []
|
26 |
for human, assistant in history:
|
27 |
messages_prompts.append({"role": "user", "content": human})
|
28 |
messages_prompts.append({"role": "assistant", "content": assistant})
|
|
|
44 |
fn=chat_stream_completion,
|
45 |
title=title,
|
46 |
description=description,
|
47 |
+
#additional_inputs=[gr.Textbox("Du bist ein hilfreicher Assistent.")],
|
48 |
+
#additional_inputs_accordion="📝 System prompt",
|
49 |
examples=[
|
50 |
["Was ist ein Large Language Model?"],
|
51 |
["Was ist 9+2-1?"],
|