mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 09:40:20 +01:00
Minor fix
This commit is contained in:
parent
983eef1e29
commit
f34d20922c
@ -82,8 +82,9 @@ def calculate_perplexity(models, input_dataset, stride, _max_length):
|
|||||||
yield cumulative_log + "Tokenizing the input dataset...\n\n"
|
yield cumulative_log + "Tokenizing the input dataset...\n\n"
|
||||||
encodings = encode(text, add_special_tokens=False)
|
encodings = encode(text, add_special_tokens=False)
|
||||||
seq_len = encodings.shape[1]
|
seq_len = encodings.shape[1]
|
||||||
if not _max_length:
|
if _max_length:
|
||||||
if hasattr(shared.model.config, 'max_position_embeddings'):
|
max_length = _max_length
|
||||||
|
elif hasattr(shared.model.config, 'max_position_embeddings'):
|
||||||
max_length = shared.model.config.max_position_embeddings
|
max_length = shared.model.config.max_position_embeddings
|
||||||
else:
|
else:
|
||||||
max_length = 2048
|
max_length = 2048
|
||||||
|
Loading…
Reference in New Issue
Block a user