Skip to content

Commit

Permalink
解决冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
chengaofei committed Sep 5, 2024
2 parents d0092ba + e1ca0ed commit 26ca23b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions easy_rec/python/protos/tower.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ message BayesTaskTower {
optional uint32 ait_project_dim = 18;
// training loss label dynamic weights
optional string dynamic_weight = 19;

};
22 changes: 22 additions & 0 deletions easy_rec/python/tools/add_feature_info_to_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ def main(argv):
logging.info('drop feature: %s' % feature_name)
feature_group.ClearField('feature_names')
feature_group.feature_names.extend(reserved_features)
for sequence_feature in feature_group.sequence_features:
seq_att_maps = sequence_feature.seq_att_map
for seq_att in seq_att_maps:
keys = seq_att.key
reserved_keys = []
for key in keys:
if key not in drop_feature_names:
reserved_keys.append(key)
else:
logging.info('drop sequence feature key: %s' % key)
seq_att.ClearField('key')
seq_att.key.extend(reserved_keys)

hist_seqs = seq_att.hist_seq
reserved_hist_seqs = []
for hist_seq in hist_seqs:
if hist_seq not in drop_feature_names:
reserved_hist_seqs.append(hist_seq)
else:
logging.info('drop sequence feature hist_seq: %s' % hist_seq)
seq_att.ClearField('hist_seq')
seq_att.hist_seq.extend(reserved_hist_seqs)

config_dir, config_name = os.path.split(FLAGS.output_config_path)
config_util.save_pipeline_config(pipeline_config, config_dir, config_name)
Expand Down

0 comments on commit 26ca23b

Please sign in to comment.