Skip to content

Commit 8bb2513

Browse files
add internlm test (#491)
* add internlm test * update comment
1 parent d3ceab4 commit 8bb2513

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/models/test_model_internlm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ class TestInternlm(ModelTest):
44
NATIVE_MODEL_ID = "internlm/internlm-7b"
55

66
def test_internlm(self):
7+
# transformers<=4.44.2 run normal
78
model, tokenizer = self.quantModel(self.NATIVE_MODEL_ID, trust_remote_code=True)
89

9-
reference_output = ""
10+
reference_output = " <s>I am in Paris and I am in love with the city. I am in love with the people. I am in love with the food. I am in love with the art. I am in love with the architecture. I am in love with the fashion. I am in love with the language. I am in love with the history. I am in love with the culture. I am in love with the romance. I am in love with the city.\nI am in love with the city. I am in love"
1011
result = self.generate(model, tokenizer)
1112

12-
self.assertTrue(len(result) > 0)
13-
# self.assertEqual(result[:self.GENERATE_EVAL_SIZE], reference_output[:self.GENERATE_EVAL_SIZE])
13+
self.assertEqual(result[:self.GENERATE_EVAL_SIZE], reference_output[:self.GENERATE_EVAL_SIZE])

tests/models/test_model_internlm2_5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ class TestInternlm2_5(ModelTest):
44
NATIVE_MODEL_ID = "internlm/internlm2_5-1_8b-chat"
55

66
def test_internlm2_5(self):
7+
# transformers<=4.44.2 run normal
78
model, tokenizer = self.quantModel(self.NATIVE_MODEL_ID, trust_remote_code=True)
8-
reference_output = "<|begin_of_text|>I am in Paris and I am so excited to be here! The city of love, art, fashion, and food. I have been dreaming of visiting Paris for years, and now that I am finally here, I am determined to make the most of my time. I have a list of all the must-see sights, but I also want to explore the city like a local. I want to discover the hidden gems, the secret spots, and the authentic experiences that only a local would know about."
9+
reference_output = "<s>I am in Paris and I want to visit the Eiffel Tower. I have a 3 day trip to Paris. I want to visit the Eiffel Tower, the Louvre Museum, and the Notre Dame Cathedral. I have a budget of $100 per day. I can stay in hotels or hostels. I can also use public transportation.I have a good idea of how to get around Paris. I will stay in a hotel or hostel for the first two nights. I will stay in a hotel"
910
result = self.generate(model, tokenizer)
1011

1112
self.assertEqual(result[:self.GENERATE_EVAL_SIZE], reference_output[:self.GENERATE_EVAL_SIZE])

0 commit comments

Comments
 (0)