mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-30 19:21:39 +00:00
Reworked so everything is in classes for easy expansion. Single entry point for all config files now.
This commit is contained in:
15
toolkit/job.py
Normal file
15
toolkit/job.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from jobs import BaseJob
|
||||
from toolkit.config import get_config
|
||||
|
||||
|
||||
def get_job(config_path) -> BaseJob:
|
||||
config = get_config(config_path)
|
||||
if not config['job']:
|
||||
raise ValueError('config file is invalid. Missing "job" key')
|
||||
|
||||
job = config['job']
|
||||
if job == 'extract':
|
||||
from jobs import ExtractJob
|
||||
return ExtractJob(config)
|
||||
else:
|
||||
raise ValueError(f'Unknown job type {job}')
|
||||
Reference in New Issue
Block a user