Skip to content

Commit 4c93ae1

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Use UTC datetime and rename 'timestamps' column to 'output_time_utc'
1 parent 037bf4b commit 4c93ae1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

openlayer/model_runners/ll_model_runners.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Module with the concrete LLM runners.
44
"""
55

6+
import datetime
67
import logging
7-
import time
88
import warnings
99
from abc import ABC, abstractmethod
1010
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
@@ -104,7 +104,7 @@ def _run_in_memory_and_yield_progress(
104104
model_outputs.append(output_value)
105105
current_row += 1
106106
yield pd.DataFrame(
107-
{"predictions": model_outputs, "timestamps": timestamps}
107+
{"predictions": model_outputs, "output_time_utc": timestamps}
108108
), current_row / total_rows
109109
continue
110110

@@ -113,11 +113,11 @@ def _run_in_memory_and_yield_progress(
113113
model_outputs.append(output)
114114
run_cost += cost
115115
run_exceptions.update(exceptions)
116-
timestamps.append(time.time())
116+
timestamps.append(datetime.datetime.utcnow().isoformat())
117117
current_row += 1
118118

119119
yield pd.DataFrame(
120-
{"predictions": model_outputs, "timestamps": timestamps}
120+
{"predictions": model_outputs, "output_time_utc": timestamps}
121121
), current_row / total_rows
122122

123123
self.logger.info("Successfully ran data through the model!")
@@ -126,7 +126,7 @@ def _run_in_memory_and_yield_progress(
126126
self.cost_estimates.append(run_cost)
127127

128128
yield pd.DataFrame(
129-
{"predictions": model_outputs, "timestamps": timestamps}
129+
{"predictions": model_outputs, "output_time_utc": timestamps}
130130
), 1.0
131131

132132
def _run_single_input(self, input_data_row: pd.Series) -> Tuple[str, float, set]:

openlayer/model_runners/traditional_ml_model_runners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
"""
66
import ast
7+
import datetime
78
import os
89
import shutil
910
import tempfile
10-
import time
1111
from abc import ABC, abstractmethod
1212

1313
import pandas as pd
@@ -72,7 +72,7 @@ def _run_in_conda(self, input_data: pd.DataFrame) -> pd.DataFrame:
7272
output_data = pd.read_csv(f"{temp_dir}/output_data.csv")
7373

7474
output_data = self._post_process_output(output_data)
75-
output_data["timestamps"] = time.time()
75+
output_data["output_time_utc"] = datetime.datetime.utcnow().isoformat()
7676

7777
return output_data
7878

0 commit comments

Comments
 (0)