mirror of
https://github.com/wassname/multifit.git
synced 2026-09-10 12:12:50 +08:00
Add end to end test and improve the train_clas params
This commit is contained in:
+14
-2
@@ -43,14 +43,26 @@ def get_texts(path):
|
||||
return np.array(texts), np.array(labels)
|
||||
|
||||
|
||||
def ensure_paths_exists(*paths):
|
||||
def ensure_paths_exists(*paths, message="One or more required files cannot be found."):
|
||||
error = False
|
||||
for path in paths:
|
||||
if not path.exists():
|
||||
print(f'Error: {path} does not exist.')
|
||||
error = True
|
||||
if error:
|
||||
raise FileNotFoundError("One or more required files cannot be found.")
|
||||
raise FileNotFoundError(message)
|
||||
|
||||
def get_data_folder():
|
||||
"""
|
||||
return data folder to use for future processing
|
||||
"""
|
||||
return (pathlib.Path(__file__).parent.parent / "data")
|
||||
|
||||
def get_scripts_folder():
|
||||
"""
|
||||
return data folder to use for future processing
|
||||
"""
|
||||
return (pathlib.Path(__file__).parent.parent)
|
||||
|
||||
def prepare_imdb(file_path: str, prepare_lm = False):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user