Skip to content

Commit

Permalink
time generate method
Browse files Browse the repository at this point in the history
Signed-off-by: arendu <adithya.r@gmail.com>
  • Loading branch information
arendu committed Nov 19, 2024
1 parent d27c4a5 commit 0278a01
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nemo/collections/nlp/modules/common/text_generation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ def put(self):
if neighbors is not None:
self.inference_strategy.update_neighbors(neighbors)

st = time.perf_counter()
output = generate(
self.model,
sentences,
Expand All @@ -422,6 +423,8 @@ def put(self):
random_seed=random_seed,
**extra,
)
tdiff = time.perf_counter() - st
logging.info(f"Chat server generation completed in {tdiff} seconds")
for k in output:
if isinstance(output[k], torch.Tensor):
output[k] = output[k].tolist()
Expand Down

0 comments on commit 0278a01

Please sign in to comment.