Skip to content

Commit

Permalink
Merge pull request #21 from TianyiQ/main
Browse files Browse the repository at this point in the history
fix(abstractions): fix dialogue inference
  • Loading branch information
TianyiQ authored Dec 3, 2024
2 parents f32da8f + d5cca3d commit 2523d8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/abstractions/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def vllm_process_batch(
sgl = import_from_sglang()
if template_type != "auto":
warnings.warn(
f"SGLang backend only supports auto template type. Ignoring template_type={template_type}. This is not an issue if you simply intend to perform inference on HistLlama models, but may be an issue if you are using a custom model, in which case you may use NO_SGLANG=1 to disable sglang backend."
f"SGLang backend only supports auto template type. Ignoring template_type={template_type}. This is not an issue if you simply intend to perform inference on HistLlama models, but may be an issue if the model is neither in the HistLlama family nor in SGLang's supported models list, in which case you may use NO_SGLANG=1 to disable sglang backend."
)

with open(os.devnull, "w") as devnull:
Expand Down Expand Up @@ -577,7 +577,8 @@ def dict_to_dialogue_list(

if "history" in dic:
for turn in dic["history"]:
res.append({"role": "user", "content": turn[0]}, {"role": "assistant", "content": turn[1]})
res.append({"role": "user", "content": turn[0]})
res.append({"role": "assistant", "content": turn[1]})

if "input" in dic or "instruction" in dic:
input = dic.get("input", "")
Expand Down

0 comments on commit 2523d8c

Please sign in to comment.