Reuse asymmetric.setup & input validation from asymmetric & org_to_jsonl

Create asymmetric.setup method to
  - initialize model
  - generate compressed jsonl
  - compute embeddings

put input_files, input_file_filter validation in org_to_jsonl for
reuse in main.py, asymmetic.py
This commit is contained in:
Debanjum Singh Solanky
2021-08-16 23:58:24 -07:00
parent 02a84df37a
commit c35c6fb0b3
3 changed files with 33 additions and 40 deletions

View File

@@ -12,6 +12,11 @@ import gzip
# Define Functions
def org_to_jsonl(org_files, org_file_filter, output_file, verbose=0):
# Input Validation
if is_none_or_empty(org_files) and is_none_or_empty(org_file_filter):
print("At least one of org-files or org-file-filter is required to be specified")
exit(1)
# Get Org Files to Process
org_files = get_org_files(org_files, org_file_filter, verbose)
@@ -132,10 +137,5 @@ if __name__ == '__main__':
parser.add_argument('--verbose', '-v', action='count', default=0, help="Show verbose conversion logs, Default: 0")
args = parser.parse_args()
# Input Validation
if is_none_or_empty(args.input_files) and is_none_or_empty(args.input_filter):
print("At least one of org-files or org-file-filter is required to be specified")
exit(1)
# Map notes in Org-Mode files to (compressed) JSONL formatted file
org_to_jsonl(args.input_files, args.input_filter, args.output_file, args.verbose)