haijunlv commited on
Commit
6736e6a
·
verified ·
1 Parent(s): 6170223

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +139 -11
README.md CHANGED
@@ -29,7 +29,7 @@
29
 
30
  ## Introduction
31
 
32
- InternLM3 has open-sourced an 8 billion parameter instruction model, InternLM3-8B-Instruct, designed for general-purpose usage and advanced reasoning. This model has the following characteristics:
33
 
34
  - **Enhanced performance at reduced cost**:
35
  State-of-the-art performance on reasoning and knowledge-intensive tasks surpass models like Llama3.1-8B and Qwen2.5-7B. Remarkably, InternLM3 is trained on only 4 trillion high-quality tokens, saving more than 75% of the training cost compared to other LLMs of similar scale.
@@ -60,16 +60,17 @@ We conducted a comprehensive evaluation of InternLM using the open-source evalua
60
  | Coding | LiveCodeBench(2407-2409 Pass@1) | **17.8** | 16.8 | 12.9 | 21.8 |
61
  | | HumanEval(Pass@1) | 82.3 | **85.4** | 72.0 | 86.6 |
62
  | Instrunction | IFEval(Prompt-Strict) | **79.3** | 71.7 | 75.2 | 79.7 |
63
- | LongContext | RULER(4-128K Average) | 87.9 | 81.4 | **88.5** | 90.7 |
64
  | Chat | AlpacaEval 2.0(LC WinRate) | **51.1** | 30.3 | 25.0 | 50.7 |
65
  | | WildBench(Raw Score) | **33.1** | 23.3 | 1.5 | 40.3 |
66
  | | MT-Bench-101(Score 1-10) | **8.59** | 8.49 | 8.37 | 8.87 |
 
67
  - The evaluation results were obtained from [OpenCompass](https://github.com/internLM/OpenCompass/) (some data marked with *, which means come from the original papers), and evaluation configuration can be found in the configuration files provided by [OpenCompass](https://github.com/internLM/OpenCompass/).
68
  - The evaluation data may have numerical differences due to the version iteration of [OpenCompass](https://github.com/internLM/OpenCompass/), so please refer to the latest evaluation results of [OpenCompass](https://github.com/internLM/OpenCompass/).
69
 
70
  **Limitations:** Although we have made efforts to ensure the safety of the model during the training process and to encourage the model to generate text that complies with ethical and legal requirements, the model may still produce unexpected outputs due to its size and probabilistic generation paradigm. For example, the generated responses may contain biases, discrimination, or other harmful content. Please do not propagate such content. We are not responsible for any consequences resulting from the dissemination of harmful information.
71
 
72
- ### Conersation Mode
73
 
74
  #### Transformers inference
75
 
@@ -121,7 +122,7 @@ You can run batch inference locally with the following python code:
121
  import lmdeploy
122
  model_dir = "internlm/internlm3-8b-instruct"
123
  pipe = lmdeploy.pipeline(model_dir)
124
- response = pipe(["Please tell me five scenic spots in Shanghai"])
125
  print(response)
126
 
127
  ```
@@ -151,7 +152,42 @@ Find more details in the [LMDeploy documentation](https://lmdeploy.readthedocs.i
151
 
152
  #### vLLM inference
153
 
154
- TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
 
157
 
@@ -272,7 +308,36 @@ print(response)
272
 
273
  #### vLLM inference
274
 
275
- TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
 
278
 
@@ -332,6 +397,7 @@ InternLM3是开源社区首个支持浏览器使用的通用对话模型。在
332
  | Chat | AlpacaEval 2.0(LC WinRate) | **51.1** | 30.3 | 25.0 | 50.7 |
333
  | | WildBench(Raw Score) | **33.1** | 23.3 | 1.5 | 40.3 |
334
  | | MT-Bench-101(Score 1-10) | **8.59** | 8.49 | 8.37 | 8.87 |
 
335
  - 以上评测结果基于 [OpenCompass](https://github.com/internLM/OpenCompass/) 获得(部分数据标注`*`代表数据来自原始论文),具体测试细节可参见 [OpenCompass](https://github.com/internLM/OpenCompass/) 中提供的配置文件。
336
  - 评测数据会因 [OpenCompass](https://github.com/internLM/OpenCompass/) 的版本迭代而存在数值差异,请以 [OpenCompass](https://github.com/internLM/OpenCompass/) 最新版的评测结果为主。
337
 
@@ -407,7 +473,7 @@ lmdeploy serve api_server internlm/internlm3-8b-instruct --model-name internlm3-
407
  curl http://localhost:23333/v1/chat/completions \
408
  -H "Content-Type: application/json" \
409
  -d '{
410
- "model": "internlm2_5-7b-chat",
411
  "messages": [
412
  {"role": "user", "content": "介绍一下深度学习。"}
413
  ]
@@ -419,9 +485,42 @@ curl http://localhost:23333/v1/chat/completions \
419
 
420
 
421
  ##### vLLM 推理
422
- TODO
 
 
 
 
 
 
 
423
 
424
- #### 深度推理模式
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
 
426
  ##### 解谜 demo
427
 
@@ -432,7 +531,7 @@ TODO
432
 
433
 
434
 
435
- ##### 深度推理 system prompt
436
 
437
  ```python
438
  thinking_system_prompt = """You are an expert mathematician with extensive experience in mathematical competitions. You approach problems through systematic thinking and rigorous reasoning. When solving problems, follow these thought processes:
@@ -541,7 +640,36 @@ print(response)
541
 
542
  ##### vLLM 推理
543
 
544
- TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
 
546
 
547
 
 
29
 
30
  ## Introduction
31
 
32
+ InternLM3 has open-sourced an 8-billion parameter instruction model, InternLM3-8B-Instruct, designed for general-purpose usage and advanced reasoning. This model has the following characteristics:
33
 
34
  - **Enhanced performance at reduced cost**:
35
  State-of-the-art performance on reasoning and knowledge-intensive tasks surpass models like Llama3.1-8B and Qwen2.5-7B. Remarkably, InternLM3 is trained on only 4 trillion high-quality tokens, saving more than 75% of the training cost compared to other LLMs of similar scale.
 
60
  | Coding | LiveCodeBench(2407-2409 Pass@1) | **17.8** | 16.8 | 12.9 | 21.8 |
61
  | | HumanEval(Pass@1) | 82.3 | **85.4** | 72.0 | 86.6 |
62
  | Instrunction | IFEval(Prompt-Strict) | **79.3** | 71.7 | 75.2 | 79.7 |
63
+ | Long Context | RULER(4-128K Average) | 87.9 | 81.4 | **88.5** | 90.7 |
64
  | Chat | AlpacaEval 2.0(LC WinRate) | **51.1** | 30.3 | 25.0 | 50.7 |
65
  | | WildBench(Raw Score) | **33.1** | 23.3 | 1.5 | 40.3 |
66
  | | MT-Bench-101(Score 1-10) | **8.59** | 8.49 | 8.37 | 8.87 |
67
+
68
  - The evaluation results were obtained from [OpenCompass](https://github.com/internLM/OpenCompass/) (some data marked with *, which means come from the original papers), and evaluation configuration can be found in the configuration files provided by [OpenCompass](https://github.com/internLM/OpenCompass/).
69
  - The evaluation data may have numerical differences due to the version iteration of [OpenCompass](https://github.com/internLM/OpenCompass/), so please refer to the latest evaluation results of [OpenCompass](https://github.com/internLM/OpenCompass/).
70
 
71
  **Limitations:** Although we have made efforts to ensure the safety of the model during the training process and to encourage the model to generate text that complies with ethical and legal requirements, the model may still produce unexpected outputs due to its size and probabilistic generation paradigm. For example, the generated responses may contain biases, discrimination, or other harmful content. Please do not propagate such content. We are not responsible for any consequences resulting from the dissemination of harmful information.
72
 
73
+ ### Conversation Mode
74
 
75
  #### Transformers inference
76
 
 
122
  import lmdeploy
123
  model_dir = "internlm/internlm3-8b-instruct"
124
  pipe = lmdeploy.pipeline(model_dir)
125
+ response = pipe("Please tell me five scenic spots in Shanghai")
126
  print(response)
127
 
128
  ```
 
152
 
153
  #### vLLM inference
154
 
155
+ We are still working on merging the PR(https://github.com/vllm-project/vllm/pull/12037) into vLLM. In the meantime, please use the following PR link to install it manually.
156
+
157
+ ```python
158
+ git clone https://github.com/RunningLeon/vllm.git
159
+ pip install -e .
160
+ ```
161
+
162
+ inference code:
163
+
164
+ ```python
165
+ from vllm import LLM, SamplingParams
166
+
167
+ llm = LLM(model="internlm/internlm3-8b-instruct")
168
+ sampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)
169
+
170
+ system_prompt = """You are an AI assistant whose name is InternLM (书生·浦语).
171
+ - InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.
172
+ - InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文."""
173
+
174
+ prompts = [
175
+ {
176
+ "role": "system",
177
+ "content": system_prompt,
178
+ },
179
+ {
180
+ "role": "user",
181
+ "content": "Please tell me five scenic spots in Shanghai"
182
+ },
183
+ ]
184
+ outputs = llm.chat(prompts,
185
+ sampling_params=sampling_params,
186
+ use_tqdm=False)
187
+ print(outputs)
188
+ ```
189
+
190
+
191
 
192
 
193
 
 
308
 
309
  #### vLLM inference
310
 
311
+ We are still working on merging the PR(https://github.com/vllm-project/vllm/pull/12037) into vLLM. In the meantime, please use the following PR link to install it manually.
312
+ ```python
313
+ git clone https://github.com/RunningLeon/vllm.git
314
+ pip install -e .
315
+ ```
316
+
317
+ inference code
318
+
319
+
320
+ ```python
321
+ from vllm import LLM, SamplingParams
322
+
323
+ llm = LLM(model="internlm/internlm3-8b-instruct")
324
+ sampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8, max_tokens=8192)
325
+
326
+ prompts = [
327
+ {
328
+ "role": "system",
329
+ "content": thinking_system_prompt,
330
+ },
331
+ {
332
+ "role": "user",
333
+ "content": "Given the function\(f(x)=\mathrm{e}^{x}-ax - a^{3}\),\n(1) When \(a = 1\), find the equation of the tangent line to the curve \(y = f(x)\) at the point \((1,f(1))\).\n(2) If \(f(x)\) has a local minimum and the minimum value is less than \(0\), determine the range of values for \(a\)."
334
+ },
335
+ ]
336
+ outputs = llm.chat(prompts,
337
+ sampling_params=sampling_params,
338
+ use_tqdm=False)
339
+ print(outputs)
340
+ ```
341
 
342
 
343
 
 
397
  | Chat | AlpacaEval 2.0(LC WinRate) | **51.1** | 30.3 | 25.0 | 50.7 |
398
  | | WildBench(Raw Score) | **33.1** | 23.3 | 1.5 | 40.3 |
399
  | | MT-Bench-101(Score 1-10) | **8.59** | 8.49 | 8.37 | 8.87 |
400
+
401
  - 以上评测结果基于 [OpenCompass](https://github.com/internLM/OpenCompass/) 获得(部分数据标注`*`代表数据来自原始论文),具体测试细节可参见 [OpenCompass](https://github.com/internLM/OpenCompass/) 中提供的配置文件。
402
  - 评测数据会因 [OpenCompass](https://github.com/internLM/OpenCompass/) 的版本迭代而存在数值差异,请以 [OpenCompass](https://github.com/internLM/OpenCompass/) 最新版的评测结果为主。
403
 
 
473
  curl http://localhost:23333/v1/chat/completions \
474
  -H "Content-Type: application/json" \
475
  -d '{
476
+ "model": "internlm3-8b-instruct",
477
  "messages": [
478
  {"role": "user", "content": "介绍一下深度学习。"}
479
  ]
 
485
 
486
 
487
  ##### vLLM 推理
488
+ 我们还在推动PR(https://github.com/vllm-project/vllm/pull/12037) 合入vllm,现在请使用以下PR链接手动安装
489
+
490
+ ```python
491
+ git clone https://github.com/RunningLeon/vllm.git
492
+ pip install -e .
493
+ ```
494
+
495
+ 推理代码
496
 
497
+ ```python
498
+ from vllm import LLM, SamplingParams
499
+
500
+ llm = LLM(model="internlm/internlm3-8b-instruct")
501
+ sampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8)
502
+
503
+ system_prompt = """You are an AI assistant whose name is InternLM (书生·浦语).
504
+ - InternLM (书生·浦语) is a conversational language model that is developed by Shanghai AI Laboratory (上海人工智能实验室). It is designed to be helpful, honest, and harmless.
505
+ - InternLM (书生·浦语) can understand and communicate fluently in the language chosen by the user such as English and 中文."""
506
+
507
+ prompts = [
508
+ {
509
+ "role": "system",
510
+ "content": system_prompt,
511
+ },
512
+ {
513
+ "role": "user",
514
+ "content": "Please tell me five scenic spots in Shanghai"
515
+ },
516
+ ]
517
+ outputs = llm.chat(prompts,
518
+ sampling_params=sampling_params,
519
+ use_tqdm=False)
520
+ print(outputs)
521
+ ```
522
+
523
+ #### 深度思考模式
524
 
525
  ##### 解谜 demo
526
 
 
531
 
532
 
533
 
534
+ ##### 深度思考 system prompt
535
 
536
  ```python
537
  thinking_system_prompt = """You are an expert mathematician with extensive experience in mathematical competitions. You approach problems through systematic thinking and rigorous reasoning. When solving problems, follow these thought processes:
 
640
 
641
  ##### vLLM 推理
642
 
643
+ 我们还在推动PR(https://github.com/vllm-project/vllm/pull/12037) 合入vllm,现在请使用以下PR链接手动安装
644
+
645
+ ```python
646
+ git clone https://github.com/RunningLeon/vllm.git
647
+ pip install -e .
648
+ ```
649
+
650
+ 推理代码
651
+
652
+ ```python
653
+ from vllm import LLM, SamplingParams
654
+
655
+ llm = LLM(model="internlm/internlm3-8b-instruct")
656
+ sampling_params = SamplingParams(temperature=1, repetition_penalty=1.005, top_k=40, top_p=0.8, max_tokens=8192)
657
+
658
+ prompts = [
659
+ {
660
+ "role": "system",
661
+ "content": thinking_system_prompt,
662
+ },
663
+ {
664
+ "role": "user",
665
+ "content": "Given the function\(f(x)=\mathrm{e}^{x}-ax - a^{3}\),\n(1) When \(a = 1\), find the equation of the tangent line to the curve \(y = f(x)\) at the point \((1,f(1))\).\n(2) If \(f(x)\) has a local minimum and the minimum value is less than \(0\), determine the range of values for \(a\)."
666
+ },
667
+ ]
668
+ outputs = llm.chat(prompts,
669
+ sampling_params=sampling_params,
670
+ use_tqdm=False)
671
+ print(outputs)
672
+ ```
673
 
674
 
675