File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,16 @@ def run_eval(
140140 file_exists = False
141141 try :
142142 path_ = file_ .get ("path" )
143- hl_file = client .files .retrieve_by_path (path = path_ )
144- if hl_file .type != type_ :
145- sys .stdout .write (
146- f"{ RED } Error in your `file` argument:\n \n The file type { hl_file .type } does not "
147- f"match the type of the File at { path_ } : { type_ } .{ RESET } "
148- )
149- return []
150- file_exists = True
151- sys .stdout .write (f"{ CYAN } Using the File definition from Humanloop workspace: { path_ } { RESET } " )
143+ if path_ is not None :
144+ hl_file = client .files .retrieve_by_path (path = path_ )
145+ if hl_file .type != type_ :
146+ sys .stdout .write (
147+ f"{ RED } Error in your `file` argument:\n \n The file type { type_ } does not "
148+ f"match the type of the File at { path_ } : { hl_file .type } .{ RESET } "
149+ )
150+ return []
151+ file_exists = True
152+ sys .stdout .write (f"{ CYAN } Using the File definition from Humanloop workspace: { path_ } { RESET } " )
152153 except ApiError as e :
153154 if e .status_code == 404 :
154155 # Let's create the file
@@ -220,11 +221,13 @@ def handle_exit_signal(signum, frame):
220221 # Generate locally if a file `callable` is provided
221222 if function_ is None :
222223 # TODO: trigger run when updated API is available
223- sys .stdout .write (f"{ CYAN } \n Running '{ hl_file .name } ' over the Dataset '{ hl_dataset .name } '{ RESET } \n " )
224+ sys .stdout .write (
225+ f"{ CYAN } \n Running '{ hl_file .name } ' { hl_file .type .capitalize ()} over the Dataset '{ hl_dataset .name } '{ RESET } \n "
226+ )
224227 else :
225228 # Running the evaluation locally
226229 sys .stdout .write (
227- f"{ CYAN } \n Running '{ hl_file .name } ' over the Dataset '{ hl_dataset .name } ' using { workers } workers...{ RESET } \n \n "
230+ f"{ CYAN } \n Running '{ hl_file .name } ' { hl_file . type . capitalize () } over the Dataset '{ hl_dataset .name } ' using { workers } workers...{ RESET } \n \n "
228231 )
229232
230233 _PROGRESS_BAR = _SimpleProgressBar (len (hl_dataset .datapoints ))
You can’t perform that action at this time.
0 commit comments