Skip to content

Commit

Permalink
Merge pull request #10 from JC1DA/overhaul_loc
Browse files Browse the repository at this point in the history
fix None metrics for cpu/mem
  • Loading branch information
nopdive authored Oct 22, 2024
2 parents 0e632bf + 4f9d80d commit 7f58ddb
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions guidance/models/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,9 @@ async def _emit(self):
time_elapsed = time_end - time_start
self._renderer.update(MetricMessage(name="wall time", value=time_elapsed))

self._renderer.update(
MetricMessage(
name="cpu", value=self._monitor.get_metric(MonitoringMetric.CPU_USAGE)
)
)
self._renderer.update(MetricMessage(name="cpu", value=cpu_percent))

self._renderer.update(
MetricMessage(
name="ram", value=self._monitor.get_metric(MonitoringMetric.MEM_USAGE)
)
)
self._renderer.update(MetricMessage(name="ram", value=mem_percent))

self._renderer.update(MetricMessage(name="gpu", value=gpu_percent))

Expand Down Expand Up @@ -251,7 +243,7 @@ def _msg_recv(self, message: GuidanceMessage) -> None:
self.renderer.update(
ExecutionCompletedOutputMessage(
trace_id=last_trace_id,
text=self.tokenizer.decode(tokens).decode("utf-8"),
text=self.tokenizer.decode(tokens).decode("utf-8"),
tokens=processed_gen_tokens,
)
)
Expand Down

0 comments on commit 7f58ddb

Please sign in to comment.