Phoenix21 commited on
Commit
970259d
·
verified ·
1 Parent(s): 012428a

Update pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +2 -2
pipeline.py CHANGED
@@ -402,7 +402,7 @@ def run_pipeline(query: str) -> str:
402
 
403
  # If out-of-scope, refuse
404
  if classification == "OutOfScope":
405
- refusal_text = refusal_chain.run({"topic": topic})
406
  return tailor_chain.run({"response": refusal_text}).strip()
407
 
408
  # Otherwise, do a RAG query and also do a web search (cached)
@@ -431,7 +431,7 @@ def run_pipeline(query: str) -> str:
431
  return tailor_chain.run({"response": final_merged}).strip()
432
 
433
  # If it doesn't fall under known categories, return refusal by default.
434
- refusal_text = refusal_chain.run({"topic": topic})
435
  return tailor_chain.run({"response": refusal_text}).strip()
436
 
437
  except ValidationError as e:
 
402
 
403
  # If out-of-scope, refuse
404
  if classification == "OutOfScope":
405
+ refusal_text = refusal_chain.invoke({"topic": topic,"query":query}})
406
  return tailor_chain.run({"response": refusal_text}).strip()
407
 
408
  # Otherwise, do a RAG query and also do a web search (cached)
 
431
  return tailor_chain.run({"response": final_merged}).strip()
432
 
433
  # If it doesn't fall under known categories, return refusal by default.
434
+ refusal_text = refusal_chain.invoke({"topic": topic,"query":query})
435
  return tailor_chain.run({"response": refusal_text}).strip()
436
 
437
  except ValidationError as e: