Fix n_ctx issue for Baichuan & Baichuan2 13B model
Signed-off-by: caiyesd <caiyesd@gmail.com>
This commit is contained in:
parent
8e672efe63
commit
7209a6ae0b
1 changed files with 2 additions and 0 deletions
|
@ -229,6 +229,8 @@ class Params:
|
||||||
n_ctx = config["max_sequence_length"]
|
n_ctx = config["max_sequence_length"]
|
||||||
elif "max_position_embeddings" in config:
|
elif "max_position_embeddings" in config:
|
||||||
n_ctx = config["max_position_embeddings"]
|
n_ctx = config["max_position_embeddings"]
|
||||||
|
elif "model_max_length" in config:
|
||||||
|
n_ctx = config["model_max_length"]
|
||||||
else:
|
else:
|
||||||
raise Exception("failed to guess 'n_ctx'. This model is unknown or unsupported.\n"
|
raise Exception("failed to guess 'n_ctx'. This model is unknown or unsupported.\n"
|
||||||
"Suggestion: provide 'config.json' of the model in the same directory containing model files.")
|
"Suggestion: provide 'config.json' of the model in the same directory containing model files.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue