mirror of
https://github.com/Azure/MachineLearningNotebooks.git
synced 2025-12-19 17:17:04 -05:00
28 lines
824 B
Python
28 lines
824 B
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
# Licensed under the MIT license.
|
|
|
|
import argparse
|
|
import os
|
|
|
|
print("In train.py")
|
|
print("As a data scientist, this is where I use my training code.")
|
|
|
|
parser = argparse.ArgumentParser("train")
|
|
|
|
parser.add_argument("--input_data", type=str, help="input data")
|
|
parser.add_argument("--output_train", type=str, help="output_train directory")
|
|
|
|
args = parser.parse_args()
|
|
|
|
print("Argument 1: %s" % args.input_data)
|
|
print("Argument 2: %s" % args.output_train)
|
|
|
|
if not (args.output_train is None):
|
|
os.makedirs(args.output_train, exist_ok=True)
|
|
print("%s created" % args.output_train)
|
|
|
|
with open(os.path.join(args.input_data, '20news.pkl'), 'rb') as f:
|
|
content = f.read()
|
|
with open(os.path.join(args.output_train, '20news.pkl'), 'wb') as fw:
|
|
fw.write(content)
|