Skip to content

Commit f50c46c

Browse files
committed
fix error reporting on params
1 parent c52fbc6 commit f50c46c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gadget/models/bert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BertModel(GgmlModel):
3434
def __init__(self, params, tensors, states, **kwargs):
3535
# validate batch_size
3636
if (bs := params['batch_size']) > (cl := params['bert.context_length']):
37-
raise ValueError('batch_size ({bs}) > context_length ({cl})')
37+
raise ValueError(f'batch_size ({bs}) > context_length ({cl})')
3838

3939
# pass to model constructor
4040
super().__init__(params, tensors, states, **kwargs)

gadget/models/llama.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ class LlamaModel(GgmlModel):
6565
def __init__(self, params, tensors, states, **kwargs):
6666
# validate batch_size and context_length
6767
if (bs := params['batch_size']) > (cl := params['context_length']):
68-
raise ValueError('batch_size ({bs}) > context_length ({cl})')
68+
raise ValueError(f'batch_size ({bs}) > context_length ({cl})')
6969
if (cl := params['context_length']) > (cl0 := params['llama.context_length']):
70-
raise ValueError('context_length ({cl}) > maximum context_length ({cl0})')
70+
raise ValueError(f'context_length ({cl}) > maximum context_length ({cl0})')
7171

7272
# pass to model constructor
7373
super().__init__(params, tensors, states, **kwargs)

0 commit comments

Comments
 (0)