Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <[email protected]>
  • Loading branch information
arthurscchan committed Jul 3, 2024
1 parent ceb2b0c commit e183593
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llm_toolkit/prompt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,9 @@ def _format_target(self, signature: str) -> str:
method and format it for the prompts creation.
"""
if '<init>' in signature:
target = self._format_target_constructor(signature)
else:
target = self._format_target_method(signature)
return self._format_target_constructor(signature)

return target.replace('{EXCEPTIONS}', self._format_exceptions())
return self._format_target_method(signature)

def _format_requirement(self, signature: str) -> str:
"""Formats a requirement based on the prompt template."""
Expand Down Expand Up @@ -742,6 +740,7 @@ def _format_problem(self, signature: str) -> str:
self._format_requirement(signature))
problem = problem.replace('{DATA_MAPPING}', self._format_data_filler())
problem = problem.replace('{ARGUMENTS}', self._format_arguments())
problem = problem.replace('{EXCEPTIONS}', self._format_exceptions())

self_source, cross_source = self._format_source_reference(signature)
problem = problem.replace('{SELF_SOURCE}', self_source)
Expand Down

0 comments on commit e183593

Please sign in to comment.