Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit eb6ba05

Browse files
authored
small fixes to sd (#231)
* small fixes * more small fixes
1 parent cf827ba commit eb6ba05

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

solutionbox/structured_data/datalab_solutions/structured_data/_package.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050
from . import predict
5151

5252

53-
_TF_GS_URL = 'gs://cloud-datalab/deploy/tf/tensorflow-0.12.0rc1-cp27-none-linux_x86_64.whl'
54-
55-
5653
def _default_project():
5754
import datalab.context
5855
context = datalab.context.Context.default()
@@ -171,7 +168,7 @@ def cloud_preprocess(output_dir, dataset, project_id=None):
171168

172169
print('Starting cloud preprocessing.')
173170
print('Track BigQuery status at')
174-
print('https://bigquery.cloud.google.com/queries/%s' % datalab_project_id())
171+
print('https://bigquery.cloud.google.com/queries/%s' % _default_project())
175172
preprocess.cloud_preprocess.main(args)
176173
print('Cloud preprocessing done.')
177174
finally:

solutionbox/structured_data/datalab_solutions/structured_data/predict/predict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def make_prediction_pipeline(pipeline, args):
363363
predicted_values, errors = (
364364
pipeline
365365
| 'Read CSV Files'
366-
>> beam.io.ReadFromText(args.predict_data,
366+
>> beam.io.ReadFromText(str(args.predict_data), # DF bug: DF does not work with unicode strings
367367
strip_trailing_newlines=True)
368368
| 'Batch Input'
369369
>> beam.ParDo(EmitAsBatchDoFn(args.batch_size))

solutionbox/structured_data/datalab_solutions/structured_data/trainer/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _copy_all(src_files, dest_dir):
6565
for src_file in src_files:
6666
file_name = os.path.basename(src_file)
6767
new_file_location = os.path.join(dest_dir, file_name)
68-
file_io.copy(src_file, new_file_location)
68+
file_io.copy(src_file, new_file_location, overwrite=True)
6969

7070

7171
def _recursive_copy(src_dir, dest_dir):
@@ -83,7 +83,7 @@ def _recursive_copy(src_dir, dest_dir):
8383
if file_io.is_directory(old_path):
8484
_recursive_copy(old_path, new_path)
8585
else:
86-
file_io.copy(old_path, new_path)
86+
file_io.copy(old_path, new_path, overwrite=True)
8787

8888
def serving_from_csv_input(train_config, args, keep_target):
8989
"""Read the input features from a placeholder csv string tensor."""

0 commit comments

Comments
 (0)