Skip to content

Commit

Permalink
Update task_iflytek_bert_of_theseus.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bojone authored Jul 17, 2020
1 parent a1d66e9 commit 9f6dd86
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/task_iflytek_bert_of_theseus.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,19 @@ def on_epoch_end(self, epoch, logs=None):
predecessor = build_transformer_model(
config_path=config_path,
checkpoint_path=checkpoint_path,
return_keras_model=False
return_keras_model=False,
prefix='Predecessor-'
)

# 加载预训练模型(3层)
successor = build_transformer_model(
config_path=config_path,
checkpoint_path=checkpoint_path,
return_keras_model=False,
num_hidden_layers=3
num_hidden_layers=3,
prefix='Successor-'
)

for layer in successor.model.layers:
layer.name = 'Successor-' + layer.name

# 判别模型
x_in = Input(shape=K.int_shape(predecessor.output)[1:])
x = Lambda(lambda x: x[:, 0])(x_in)
Expand Down

0 comments on commit 9f6dd86

Please sign in to comment.