binqiangliu commited on
Commit
2faf40a
·
1 Parent(s): 748f54e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -29,12 +29,11 @@ llm = HuggingFaceHub(repo_id=llama2_repo_id, #for Llama2
29
  "temperature":0.1,
30
  "top_k":50,
31
  "top_p":0.95, "eos_token_id":49155})
32
- #似乎是因为iShare不是HF的Pro账户,所以会遇到Runtime error: Scheduling failure: not enough hardware capacity(设置为llama2_repo_id时)???
33
 
34
  prompt_template = """
35
- You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.
36
- If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information. Here is the user question {user_question}.
37
- Helpful AI Answer:
38
  """
39
 
40
  llm_chain = LLMChain(llm=llm, prompt=PromptTemplate.from_template(prompt_template))
 
29
  "temperature":0.1,
30
  "top_k":50,
31
  "top_p":0.95, "eos_token_id":49155})
 
32
 
33
  prompt_template = """
34
+ <<SYS>>You are a helpful, respectful and honest assistant. If you don't know the answer to a question, please don't share false information.In each conversation, question is placed after [INST] while your answer should be placed after [/INST].<</SYS>>
35
+ [INST] {user_question} [/INST]
36
+ assistant:
37
  """
38
 
39
  llm_chain = LLMChain(llm=llm, prompt=PromptTemplate.from_template(prompt_template))