Skip to content

Commit

Permalink
Add hard limit on generated competencies to max_n
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelOwenDyer committed Aug 9, 2024
1 parent 41df050 commit 117a6e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/pipeline/competency_extraction_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def __call__(

generated_competencies: list[Competency] = []

# Find all competencies in the response
competencies = response.split("\n\n")
# Find all competencies in the response up to the max_n
competencies = response.split("\n\n")[: dto.max_n]
for i, competency in enumerate(competencies):
logger.debug(f"Processing competency {i + 1}: {competency}")
if "{" not in competency or "}" not in competency:
Expand Down

0 comments on commit 117a6e2

Please sign in to comment.