Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ chat_template = os.getenv('CHAT_TEMPLATE')
|
|
| 10 |
|
| 11 |
# Interface variables
|
| 12 |
model_name = model_id.split('/')[1].split('-GGUF')[0]
|
| 13 |
-
title = f"
|
| 14 |
description = f"Chat with <a href=\"https://huggingface.co/{model_id}\">{model_name}</a> in GGUF format ({quant})!"
|
| 15 |
|
| 16 |
# Initialize the LLM
|
|
@@ -30,7 +30,7 @@ def chat_stream_completion(message, history, system_prompt):
|
|
| 30 |
response = llm.create_chat_completion(
|
| 31 |
messages=messages_prompts,
|
| 32 |
stream=True,
|
| 33 |
-
stop=["
|
| 34 |
)
|
| 35 |
message_repl = ""
|
| 36 |
for chunk in response:
|
|
@@ -43,11 +43,11 @@ gr.ChatInterface(
|
|
| 43 |
fn=chat_stream_completion,
|
| 44 |
title=title,
|
| 45 |
description=description,
|
| 46 |
-
additional_inputs=[gr.Textbox("
|
| 47 |
additional_inputs_accordion="📝 System prompt",
|
| 48 |
examples=[
|
| 49 |
-
["
|
| 50 |
-
["
|
| 51 |
-
["
|
| 52 |
]
|
| 53 |
).queue().launch(server_name="0.0.0.0")
|
|
|
|
| 10 |
|
| 11 |
# Interface variables
|
| 12 |
model_name = model_id.split('/')[1].split('-GGUF')[0]
|
| 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 |
|
| 16 |
# Initialize the LLM
|
|
|
|
| 30 |
response = llm.create_chat_completion(
|
| 31 |
messages=messages_prompts,
|
| 32 |
stream=True,
|
| 33 |
+
stop=["<|im_end|>"]
|
| 34 |
)
|
| 35 |
message_repl = ""
|
| 36 |
for chunk in response:
|
|
|
|
| 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?"],
|
| 51 |
+
["Schreibe Python code um die Fibonacci-Reihenfolge auszugeben."]
|
| 52 |
]
|
| 53 |
).queue().launch(server_name="0.0.0.0")
|