Merge pull request #196 from db0/mult_gen_api_cluster

fix for multiple gens breaking API/CLUSTER
This commit is contained in:
henk717 2022-09-01 16:34:52 +02:00 committed by GitHub
commit b0aa615ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -5108,14 +5108,17 @@ def sendtoapi(txt, min, max):
if(len(genout) == 1):
genresult(genout[0])
else:
adjusted_genout = []
for item in genout:
adjusted_genout.append({"generated_text": item})
# Convert torch output format to transformers
seqs = []
for seq in genout:
for seq in adjusted_genout:
seqs.append({"generated_text": seq})
if(vars.lua_koboldbridge.restart_sequence is not None and vars.lua_koboldbridge.restart_sequence > 0):
genresult(genout[vars.lua_koboldbridge.restart_sequence-1]["generated_text"])
genresult(adjusted_genout[vars.lua_koboldbridge.restart_sequence-1]["generated_text"])
else:
genselect(genout)
genselect(adjusted_genout)
set_aibusy(0)
return
@ -5187,14 +5190,17 @@ def sendtocluster(txt, min, max):
if(len(genout) == 1):
genresult(genout[0])
else:
adjusted_genout = []
for item in genout:
adjusted_genout.append({"generated_text": item})
# Convert torch output format to transformers
seqs = []
for seq in genout:
for seq in adjusted_genout:
seqs.append({"generated_text": seq})
if(vars.lua_koboldbridge.restart_sequence is not None and vars.lua_koboldbridge.restart_sequence > 0):
genresult(genout[vars.lua_koboldbridge.restart_sequence-1]["generated_text"])
genresult(adjusted_genout[vars.lua_koboldbridge.restart_sequence-1]["generated_text"])
else:
genselect(genout)
genselect(adjusted_genout)
set_aibusy(0)
return