Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
@@ -13,7 +13,7 @@ def get_generation_config(path):
|
|
13 |
|
14 |
return GenerationConfig(**generation_config["generation_config"])
|
15 |
|
16 |
-
def generate_prompt(prompt, histories, ctx=None):
|
17 |
convs = f"""Below is a history of instructions that describe tasks, paired with an input that provides further context. Write a response that appropriately completes the request by remembering the conversation history.
|
18 |
|
19 |
"""
|
@@ -51,9 +51,7 @@ def generate_prompt(prompt, histories, ctx=None):
|
|
51 |
### Response:"""
|
52 |
|
53 |
convs = convs + sub_convs
|
54 |
-
|
55 |
-
|
56 |
-
return convs, len(sub_convs)
|
57 |
|
58 |
# applicable to instruction to be displayed as well
|
59 |
def common_post_process(original_str):
|
|
|
13 |
|
14 |
return GenerationConfig(**generation_config["generation_config"])
|
15 |
|
16 |
+
def generate_prompt(prompt, histories, ctx=None, partial=False):
|
17 |
convs = f"""Below is a history of instructions that describe tasks, paired with an input that provides further context. Write a response that appropriately completes the request by remembering the conversation history.
|
18 |
|
19 |
"""
|
|
|
51 |
### Response:"""
|
52 |
|
53 |
convs = convs + sub_convs
|
54 |
+
return sub_convs if partial else convs, len(sub_convs)
|
|
|
|
|
55 |
|
56 |
# applicable to instruction to be displayed as well
|
57 |
def common_post_process(original_str):
|