JanPf commited on
Commit
2ac354d
·
verified ·
1 Parent(s): 7f860f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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].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
 
@@ -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?"],