Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverchang committed Oct 30, 2024
1 parent 8c25286 commit b703998
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions report/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@

TARGET_EXTS = project_src.SEARCH_EXTS + ['.java', '.py'] + ['.fuzz_target']

_CHAT_PROMPT_START_MARKER = re.compile(r'<CHAT PROMPT:ROUND\s+\d+>')
_CHAT_PROMPT_END_MARKER = re.compile(r'</CHAT PROMPT:ROUND\s+\d+>')
_CHAT_RESPONSE_START_MARKER = re.compile(r'<CHAT RESPONSE:ROUND\s+\d+>')
_CHAT_RESPONSE_END_MARKER = re.compile(r'</CHAT RESPONSE:ROUND\s+\d+>')


@dataclasses.dataclass
class AccumulatedResult:
Expand Down Expand Up @@ -649,10 +654,6 @@ def _find_benchmark_signature(self, project: str,

def _parse_log_parts(log: str) -> list[LogPart]:
"""Parse log into parts."""
_CHAT_PROMPT_START_MARKER = re.compile(r'<CHAT PROMPT:ROUND\s+\d+>')
_CHAT_PROMPT_END_MARKER = re.compile(r'</CHAT PROMPT:ROUND\s+\d+>')
_CHAT_RESPONSE_START_MARKER = re.compile(r'<CHAT RESPONSE:ROUND\s+\d+>')
_CHAT_RESPONSE_END_MARKER = re.compile(r'</CHAT RESPONSE:ROUND\s+\d+>')
parts = []
idx = 0
next_marker = _CHAT_PROMPT_START_MARKER
Expand Down Expand Up @@ -691,7 +692,9 @@ def _parse_log_parts(log: str) -> list[LogPart]:
end_idx = len(log)
idx = end_idx

parts.append(LogPart(chat_prompt=chat_prompt, chat_response=chat_response, content=log[match.end():end_idx]))

parts.append(
LogPart(chat_prompt=chat_prompt,
chat_response=chat_response,
content=log[match.end():end_idx]))

return parts
return parts

0 comments on commit b703998

Please sign in to comment.