RTIInternational / gobbli

Deep learning with text doesn't have to be scary.
Apache License 2.0
275 stars 23 forks source link

interactive.util.format_task() uses stat.st_birthtime, which doesn't exist on Windows #25

Closed cfculhane closed 4 years ago

cfculhane commented 4 years ago

System Information

Description

Code for Minimal Reproducible Example

from pathlib import Path
Path(__file__).stat().st_birthtime  # Raises AttributeError
Path(__file__).stat().st_ctime  # Works as expected

Output

AttributeError: 'os.stat_result' object has no attribute 'st_birthtime'
Traceback:
File "c:\temp\nlp_playground\venv\lib\site-packages\streamlit\script_runner.py", line 324, in _run_script
    exec(code, module.__dict__)
File "c:\temp\nlp_playground\venv\lib\site-packages\gobbli\interactive\evaluate.py", line 313, in <module>
    run()
File "c:\temp\nlp_playground\venv\lib\site-packages\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
File "c:\temp\nlp_playground\venv\lib\site-packages\click\core.py", line 717, in main
    rv = self.invoke(ctx)
File "c:\temp\nlp_playground\venv\lib\site-packages\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
File "c:\temp\nlp_playground\venv\lib\site-packages\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
File "c:\temp\nlp_playground\venv\lib\site-packages\gobbli\interactive\evaluate.py", line 195, in run
    model_cls, model_kwargs, checkpoint_meta = st_select_model_checkpoint(
File "c:\temp\nlp_playground\venv\lib\site-packages\gobbli\interactive\util.py", line 387, in st_select_model_checkpoint
    task_formatted = format_task(task_dir)
File "c:\temp\nlp_playground\venv\lib\site-packages\gobbli\interactive\util.py", line 329, in format_task
    task_creation_time = dt.datetime.fromtimestamp(task_dir.stat().st_birthtime)
jasonnance commented 4 years ago

Thanks for the detailed report! Our merging process is a little disrupted right now, so I'm not sure how soon this will be on PyPI, but it's fixed in a branch here, at least.

jasonnance commented 4 years ago

Fixed in v0.2.3, which I've just pushed out to PyPI.