Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
Signed-off-by: marscrazy <marscrazy_90@163.com>
  • Loading branch information
marscrazy committed Jun 10, 2022
1 parent 35f3e4f commit 5b26606
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion flagai/model/glm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,6 @@ def forward(self,
position_ids,
attention_mask,
prompt_pos=prompt_pos,
labels=kwargs['labels'],
mems=kwargs['mems'])
outputs, mems = model_out['logits'], model_out['hidden_states']

Expand Down
2 changes: 1 addition & 1 deletion tests/bak_test_autoloader.py → tests/test_autoloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_T5_base_ch(self):

def test_CPM_large_ch(self):
for t_name in self.task_name:
m_name = 'CPM-large-ch'
m_name = 'CPM-large-ch-generation'
loader = AutoLoader(task_name=t_name,
model_name=m_name,
class_num=3,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_init_trainer_pytorch(self):
eval_interval=100,
log_interval=50,
experiment_name='glm_large',
pytorch_device='cpu',
pytorch_device='cuda',
load_dir=None,
lr=1e-4)
print("downloading...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_init_trainer_pytorch(self):
eval_interval=100,
log_interval=50,
experiment_name='glm_large',
pytorch_device='cpu',
pytorch_device='cuda',
load_dir=None,
lr=1e-4,
save_epoch=10)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def suite():
suite.addTest(TokenizerTestCase('test_tokenizer_t5'))
suite.addTest(TokenizerTestCase('test_tokenizer_roberta'))
suite.addTest(TokenizerTestCase('test_tokenizer_bert'))
suite.addTest(TokenizerTestCase('test_tokenizer_cpm1'))
# suite.addTest(TokenizerTestCase('test_tokenizer_cpm1'))
return suite


Expand Down

0 comments on commit 5b26606

Please sign in to comment.