zakinho00 commited on
Commit
7b12b7f
·
verified ·
1 Parent(s): cf50651

Update utils/generation.py

Browse files
Files changed (1) hide show
  1. utils/generation.py +1 -4
utils/generation.py CHANGED
@@ -81,10 +81,7 @@ def generate_answer(query, retrieved_chunks, model=model, tokenizer=tokenizer):
81
 
82
  # For causal models, remove the prompt from the output.
83
  if model_type == "causal":
84
- # Remove the prompt from the output for causal models I want to create a new radio station, what are key steps to follow to be in law ?
85
- answer = generated_text[len(prompt):].strip()
86
- clean_text = re.sub(r".*?</think>", "", answer, flags=re.DOTALL).strip()
87
- return clean_text
88
  else:
89
  return generated_text.strip()
90
 
 
81
 
82
  # For causal models, remove the prompt from the output.
83
  if model_type == "causal":
84
+ return generated_text[len(prompt):].strip()
 
 
 
85
  else:
86
  return generated_text.strip()
87