This commit is contained in:
Cyberes 2023-10-04 13:11:43 -06:00
parent d0eec88dbd
commit 754a4cbdf3
1 changed files with 1 additions and 3 deletions

View File

@ -7,11 +7,9 @@ def oai_to_vllm(request_json_body, hashes: bool, mode):
if not request_json_body.get('stop'): if not request_json_body.get('stop'):
request_json_body['stop'] = [] request_json_body['stop'] = []
if not isinstance(request_json_body['stop'], list): if not isinstance(request_json_body['stop'], list):
# It is a string, so create a list with the existing element # It is a string, so create a list with the existing element.
request_json_body['stop'] = [request_json_body['stop']] request_json_body['stop'] = [request_json_body['stop']]
print(request_json_body['stop'])
if hashes: if hashes:
request_json_body['stop'].extend(['### INSTRUCTION', '### USER', '### ASSISTANT', '### RESPONSE']) request_json_body['stop'].extend(['### INSTRUCTION', '### USER', '### ASSISTANT', '### RESPONSE'])
if opts.openai_force_no_hashes: if opts.openai_force_no_hashes: