Skip to content

Commit

Permalink
Some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzyPutterman committed May 14, 2024
1 parent ee960ee commit 2093d1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/c++/perf_analyzer/genai-perf/genai_perf/llm_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ def _get_profile_metadata(self, data: dict) -> None:
self._response_format = ResponseFormat.OPENAI_CHAT_COMPLETIONS
elif "text_completion" in response:
self._response_format = ResponseFormat.OPENAI_COMPLETIONS
elif "input_ids" in response:
self._response_format = ResponseFormat.OPENAI_COMPLETIONS
else:
raise RuntimeError("Unknown OpenAI response format.")

Expand Down Expand Up @@ -538,7 +536,6 @@ def _parse_requests(self, requests: dict) -> LLMMetrics:
time_to_first_tokens.append(res_timestamps[0] - req_timestamp)

# number of input tokens
# input_tokens = self._tokenize_request_inputs(req_inputs)
len_input_tokens = self._tokenize_request_inputs(req_inputs)
num_input_tokens.append(len_input_tokens)

Expand Down
13 changes: 7 additions & 6 deletions src/c++/perf_analyzer/genai-perf/genai_perf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,13 @@ def run():
def main():
# Interactive use will catch exceptions and log formatted errors rather than
# tracebacks.
run()
# except Exception as e:
# traceback.print_exc()
# logger = logging.getLogger(__name__)
# logger.error(e)
# return 1
try:
run()
except Exception as e:
traceback.print_exc()
logger = logging.getLogger(__name__)
logger.error(e)
return 1

return 0

Expand Down

0 comments on commit 2093d1b

Please sign in to comment.