abhi1nandy2 commited on
Commit
2b2e47a
·
verified ·
1 Parent(s): 4baf663

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -32,13 +32,13 @@ For more information on `huggingface_hub` Inference API support, please check th
32
  """
33
  client = InferenceClient("microsoft/DialoGPT-small")#("TheBloke/TinyLlama-1.1B-Chat-v1.0-GPTQ")#("TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF")#("QuantFactory/Meta-Llama-3-8B-Instruct-GGUF")#("HuggingFaceH4/zephyr-7b-beta")
34
 
35
- SYSTEM_MESSAGE = "You are a QA chatbot to answer queries on my homepage that has the following information -\n\n" + "\n\n".join(text_list)
36
 
37
  def respond(
38
  message,
39
  history: list[tuple[str, str]],
40
  system_message=SYSTEM_MESSAGE,
41
- max_tokens=200,
42
  temperature=0.7,
43
  top_p=0.95,
44
  ):
@@ -47,10 +47,10 @@ def respond(
47
  for val in history:
48
  # if val[0]:
49
  if len(val)>=1:
50
- messages.append({"role": "user", "content": val[0]})
51
  # if val[1]:
52
  if len(val)>=2:
53
- messages.append({"role": "assistant", "content": val[1]})
54
 
55
  messages.append({"role": "user", "content": message})
56
 
 
32
  """
33
  client = InferenceClient("microsoft/DialoGPT-small")#("TheBloke/TinyLlama-1.1B-Chat-v1.0-GPTQ")#("TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF")#("QuantFactory/Meta-Llama-3-8B-Instruct-GGUF")#("HuggingFaceH4/zephyr-7b-beta")
34
 
35
+ SYSTEM_MESSAGE = "You are a QA chatbot to answer queries on my homepage that has the following information -\n\n" + "\n\n".join(text_list) + "\n\n<|endoftext|>"
36
 
37
  def respond(
38
  message,
39
  history: list[tuple[str, str]],
40
  system_message=SYSTEM_MESSAGE,
41
+ max_tokens=50,
42
  temperature=0.7,
43
  top_p=0.95,
44
  ):
 
47
  for val in history:
48
  # if val[0]:
49
  if len(val)>=1:
50
+ messages.append({"role": "user", "content": val[0]+"<|endoftext|>"})
51
  # if val[1]:
52
  if len(val)>=2:
53
+ messages.append({"role": "assistant", "content": val[1]+"<|endoftext|>"})
54
 
55
  messages.append({"role": "user", "content": message})
56