Skip to content

Commit

Permalink
fix: remove space replacement (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
dilyararimovna authored May 23, 2023
1 parent e91811f commit e0a011d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions skills/dff_generative_skill/scenario/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ def gathering_responses(reply, confidence, human_attr, bot_attr, attr):
logger.info(f"hyps: {hypotheses}")
for hyp in hypotheses:
confidence = DEFAULT_CONFIDENCE
hyp_text = " ".join(hyp.split())
if len(hyp_text) and hyp_text[-1] not in [".", "?", "!"]:
hyp_text += "."
if len(hyp) and hyp[-1] not in [".", "?", "!"]:
hyp += "."
confidence = LOW_CONFIDENCE
gathering_responses(hyp_text, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})
gathering_responses(hyp, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})

if len(curr_responses) == 0:
return ""
Expand Down
7 changes: 3 additions & 4 deletions skills/dff_template_prompted_skill/scenario/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ def gathering_responses(reply, confidence, human_attr, bot_attr, attr):
logger.info(f"generated hypotheses: {hypotheses}")
for hyp in hypotheses:
confidence = DEFAULT_CONFIDENCE
hyp_text = " ".join(hyp.split())
if len(hyp_text) and hyp_text[-1] not in [".", "?", "!"]:
hyp_text += "."
if len(hyp) and hyp[-1] not in [".", "?", "!"]:
hyp += "."
confidence = LOW_CONFIDENCE
gathering_responses(hyp_text, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})
gathering_responses(hyp, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})

if len(curr_responses) == 0:
return ""
Expand Down
7 changes: 3 additions & 4 deletions skills/dff_universal_prompted_skill/scenario/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,10 @@ def gathering_responses(reply, confidence, human_attr, bot_attr, attr):
logger.info(f"generated hypotheses: {hypotheses}")
for hyp in hypotheses:
confidence = DEFAULT_CONFIDENCE
hyp_text = " ".join(hyp.split())
if len(hyp_text) and hyp_text[-1] not in [".", "?", "!"]:
hyp_text += "."
if len(hyp) and hyp[-1] not in [".", "?", "!"]:
hyp += "."
confidence = LOW_CONFIDENCE
gathering_responses(hyp_text, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})
gathering_responses(hyp, confidence, {}, {}, {"can_continue": CAN_NOT_CONTINUE})

if len(curr_responses) == 0:
return ""
Expand Down

0 comments on commit e0a011d

Please sign in to comment.