mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-08 04:24:47 +00:00
[hotfix] fix typo s/keywrods/keywords etc. (#5429)
This commit is contained in:
@@ -61,7 +61,7 @@ if __name__ == "__main__":
|
||||
information_retriever.add_documents(docs=documents, cleanup="incremental", mode="by_source", embedding=embedding)
|
||||
|
||||
prompt_template = """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.
|
||||
If the answer cannot be infered based on the given context, please don't share false information.
|
||||
If the answer cannot be inferred based on the given context, please don't share false information.
|
||||
Use the context and chat history to respond to the human's input at the end or carry on the conversation. You should generate one response only. No following up is needed.
|
||||
|
||||
context:
|
||||
|
@@ -67,7 +67,7 @@ if __name__ == "__main__":
|
||||
break
|
||||
data_name = input("Enter a short description of the data:")
|
||||
separator = input(
|
||||
"Enter a separator to force separating text into chunks, if no separator is given, the defaut separator is '\\n\\n'. Note that"
|
||||
"Enter a separator to force separating text into chunks, if no separator is given, the default separator is '\\n\\n'. Note that"
|
||||
+ "we use neural text spliter to split texts into chunks, the seperator only serves as a delimiter to force split long passage into"
|
||||
+ " chunks before passing to the neural network. Press ENTER directly to skip:"
|
||||
)
|
||||
@@ -112,7 +112,7 @@ if __name__ == "__main__":
|
||||
agent_response = retrieval_chain.run(
|
||||
query=user_input,
|
||||
stop=["Human: "],
|
||||
rejection_trigger_keywrods=EN_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_trigger_keywords=EN_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_answer=EN_RETRIEVAL_QA_REJECTION_ANSWER,
|
||||
)
|
||||
agent_response = agent_response.split("\n")[0]
|
||||
|
@@ -142,7 +142,7 @@ if __name__ == "__main__":
|
||||
agent_response = retrieval_chain.run(
|
||||
query=user_input,
|
||||
stop=["Human: "],
|
||||
rejection_trigger_keywrods=EN_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_trigger_keywords=EN_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_answer=EN_RETRIEVAL_QA_REJECTION_ANSWER,
|
||||
)
|
||||
agent_response = agent_response.split("\n")[0]
|
||||
|
@@ -11,7 +11,7 @@ if __name__ == '__main__':
|
||||
parser.add_argument('--sql_file_path', type=str, default=None, help='path to the a empty folder for storing sql files for indexing')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Will ask for documents path in runnning time
|
||||
# Will ask for documents path in running time
|
||||
session = UniversalRetrievalConversation(files_en=None,
|
||||
files_zh=None,
|
||||
zh_model_path=args.zh_model_path, en_model_path=args.en_model_path,
|
||||
|
@@ -107,7 +107,7 @@ if __name__ == "__main__":
|
||||
query=user_input,
|
||||
stop=["</答案>"],
|
||||
doc_prefix="支持文档",
|
||||
rejection_trigger_keywrods=ZH_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_trigger_keywords=ZH_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_answer=ZH_RETRIEVAL_QA_REJECTION_ANSWER,
|
||||
)
|
||||
print(f"Agent: {agent_response}")
|
||||
|
@@ -140,7 +140,7 @@ class RAG_ChatBot:
|
||||
result = self.rag_chain.run(
|
||||
query=user_input,
|
||||
stop=[memory.human_prefix + ": "],
|
||||
rejection_trigger_keywrods=ZH_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_trigger_keywords=ZH_RETRIEVAL_QA_TRIGGER_KEYWORDS,
|
||||
rejection_answer=ZH_RETRIEVAL_QA_REJECTION_ANSWER,
|
||||
)
|
||||
return result, memory
|
||||
|
Reference in New Issue
Block a user