fix(chinese-instruct.py): 修复输入为空时 build_prompt 报错问题
This commit is contained in:
+2
-2
@@ -19,8 +19,8 @@ def build_prompt(query:str, response:str) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def process_func(input_dict: dict):
|
def process_func(input_dict: dict):
|
||||||
query = input_dict["prompt"]
|
query = input_dict["prompt"] if input_dict["prompt"] else ""
|
||||||
response = input_dict["response"]
|
response = input_dict["response"] if input_dict["response"] else ""
|
||||||
return {"text": build_prompt(query, response)}
|
return {"text": build_prompt(query, response)}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user