Skip to content

Commit

Permalink
[llm_runner] Fix chat prompt history. (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
raikonenfnu authored Feb 8, 2024
1 parent a1b22ea commit 7e51239
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/turbine_models/custom_models/llm_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ def run_llm(
example_input_id = initial_input.input_ids
turbine_results = llm.generate(example_input_id)
return tokenizer.decode(turbine_results)
prompt = chat_sys_prompt
while True:
user_prompt = input("User prompt: ")
prompt = append_user_prompt(chat_sys_prompt, user_prompt)
prompt = append_user_prompt(prompt, user_prompt)
initial_input = tokenizer(prompt, return_tensors="pt")
example_input_id = initial_input.input_ids
result = llm.generate(example_input_id)
Expand Down

0 comments on commit 7e51239

Please sign in to comment.