Skip to content

Commit b0aba45

Browse files
authored
Add files via upload
1 parent ed4267c commit b0aba45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/chatyuan-test-example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
#ckpt是为了兼容苏神的模型,对于新模型我们采用keras3的weights.h5格式存储权重
2727
t5 =build_transformer_model(
2828
config_path='ChatYuan-keras/config.json',
29+
keras_weights_path='MisakaT5/T5weights.weights.h5',
2930
model='mt5.1.1',
3031
return_keras_model=False,
3132
with_lm='softmax',
3233
name='T5',
3334
)
34-
#build的时候不需要添加checkpoints_path,在load后用此方法加载
35-
t5.model.load_weights('ChatYuan-keras/T5weights.weights.h5')
35+
3636
#构建cache模型
3737
cache_model=t5.build_cache_model(input_lengths,end_token=1,
38-
search_mode=search_mode,k=k,progress_print=True,index_bias=1)
38+
search_mode=search_mode,k=k,progress_print=True,index_bias=index_bias)
3939

4040
#从bert4torch抄过来的example
4141
e_in=["帮我写一个请假条,我因为新冠不舒服,需要请假3天,请领导批准",

0 commit comments

Comments
 (0)