Instructions to use internlm/internlm2-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/internlm2-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="internlm/internlm2-7b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("internlm/internlm2-7b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use internlm/internlm2-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/internlm2-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/internlm2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/internlm/internlm2-7b
- SGLang
How to use internlm/internlm2-7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "internlm/internlm2-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/internlm2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "internlm/internlm2-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/internlm2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use internlm/internlm2-7b with Docker Model Runner:
docker model run hf.co/internlm/internlm2-7b
Adding Evaluation Results
#3
by leaderboard-pr-bot - opened
README.md
CHANGED
|
@@ -1,6 +1,109 @@
|
|
| 1 |
---
|
| 2 |
-
pipeline_tag: text-generation
|
| 3 |
license: other
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
# InternLM
|
| 6 |
|
|
@@ -163,4 +266,17 @@ print(output)
|
|
| 163 |
|
| 164 |
## 开源许可证
|
| 165 |
|
| 166 |
-
本仓库的代码依照 Apache-2.0 协议开源。模型权重对学术研究完全开放,也可申请免费的商业使用授权([申请表](https://wj.qq.com/s2/12725412/f7c1/))。其他问题与合作请联系 <internlm@pjlab.org.cn>。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
license: other
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
model-index:
|
| 5 |
+
- name: internlm2-7b
|
| 6 |
+
results:
|
| 7 |
+
- task:
|
| 8 |
+
type: text-generation
|
| 9 |
+
name: Text Generation
|
| 10 |
+
dataset:
|
| 11 |
+
name: AI2 Reasoning Challenge (25-Shot)
|
| 12 |
+
type: ai2_arc
|
| 13 |
+
config: ARC-Challenge
|
| 14 |
+
split: test
|
| 15 |
+
args:
|
| 16 |
+
num_few_shot: 25
|
| 17 |
+
metrics:
|
| 18 |
+
- type: acc_norm
|
| 19 |
+
value: 58.02
|
| 20 |
+
name: normalized accuracy
|
| 21 |
+
source:
|
| 22 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 23 |
+
name: Open LLM Leaderboard
|
| 24 |
+
- task:
|
| 25 |
+
type: text-generation
|
| 26 |
+
name: Text Generation
|
| 27 |
+
dataset:
|
| 28 |
+
name: HellaSwag (10-Shot)
|
| 29 |
+
type: hellaswag
|
| 30 |
+
split: validation
|
| 31 |
+
args:
|
| 32 |
+
num_few_shot: 10
|
| 33 |
+
metrics:
|
| 34 |
+
- type: acc_norm
|
| 35 |
+
value: 81.24
|
| 36 |
+
name: normalized accuracy
|
| 37 |
+
source:
|
| 38 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 39 |
+
name: Open LLM Leaderboard
|
| 40 |
+
- task:
|
| 41 |
+
type: text-generation
|
| 42 |
+
name: Text Generation
|
| 43 |
+
dataset:
|
| 44 |
+
name: MMLU (5-Shot)
|
| 45 |
+
type: cais/mmlu
|
| 46 |
+
config: all
|
| 47 |
+
split: test
|
| 48 |
+
args:
|
| 49 |
+
num_few_shot: 5
|
| 50 |
+
metrics:
|
| 51 |
+
- type: acc
|
| 52 |
+
value: 65.24
|
| 53 |
+
name: accuracy
|
| 54 |
+
source:
|
| 55 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 56 |
+
name: Open LLM Leaderboard
|
| 57 |
+
- task:
|
| 58 |
+
type: text-generation
|
| 59 |
+
name: Text Generation
|
| 60 |
+
dataset:
|
| 61 |
+
name: TruthfulQA (0-shot)
|
| 62 |
+
type: truthful_qa
|
| 63 |
+
config: multiple_choice
|
| 64 |
+
split: validation
|
| 65 |
+
args:
|
| 66 |
+
num_few_shot: 0
|
| 67 |
+
metrics:
|
| 68 |
+
- type: mc2
|
| 69 |
+
value: 48.73
|
| 70 |
+
source:
|
| 71 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 72 |
+
name: Open LLM Leaderboard
|
| 73 |
+
- task:
|
| 74 |
+
type: text-generation
|
| 75 |
+
name: Text Generation
|
| 76 |
+
dataset:
|
| 77 |
+
name: Winogrande (5-shot)
|
| 78 |
+
type: winogrande
|
| 79 |
+
config: winogrande_xl
|
| 80 |
+
split: validation
|
| 81 |
+
args:
|
| 82 |
+
num_few_shot: 5
|
| 83 |
+
metrics:
|
| 84 |
+
- type: acc
|
| 85 |
+
value: 83.82
|
| 86 |
+
name: accuracy
|
| 87 |
+
source:
|
| 88 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 89 |
+
name: Open LLM Leaderboard
|
| 90 |
+
- task:
|
| 91 |
+
type: text-generation
|
| 92 |
+
name: Text Generation
|
| 93 |
+
dataset:
|
| 94 |
+
name: GSM8k (5-shot)
|
| 95 |
+
type: gsm8k
|
| 96 |
+
config: main
|
| 97 |
+
split: test
|
| 98 |
+
args:
|
| 99 |
+
num_few_shot: 5
|
| 100 |
+
metrics:
|
| 101 |
+
- type: acc
|
| 102 |
+
value: 63.0
|
| 103 |
+
name: accuracy
|
| 104 |
+
source:
|
| 105 |
+
url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=internlm/internlm2-7b
|
| 106 |
+
name: Open LLM Leaderboard
|
| 107 |
---
|
| 108 |
# InternLM
|
| 109 |
|
|
|
|
| 266 |
|
| 267 |
## 开源许可证
|
| 268 |
|
| 269 |
+
本仓库的代码依照 Apache-2.0 协议开源。模型权重对学术研究完全开放,也可申请免费的商业使用授权([申请表](https://wj.qq.com/s2/12725412/f7c1/))。其他问题与合作请联系 <internlm@pjlab.org.cn>。
|
| 270 |
+
# [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
| 271 |
+
Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_internlm__internlm2-7b)
|
| 272 |
+
|
| 273 |
+
| Metric |Value|
|
| 274 |
+
|---------------------------------|----:|
|
| 275 |
+
|Avg. |66.68|
|
| 276 |
+
|AI2 Reasoning Challenge (25-Shot)|58.02|
|
| 277 |
+
|HellaSwag (10-Shot) |81.24|
|
| 278 |
+
|MMLU (5-Shot) |65.24|
|
| 279 |
+
|TruthfulQA (0-shot) |48.73|
|
| 280 |
+
|Winogrande (5-shot) |83.82|
|
| 281 |
+
|GSM8k (5-shot) |63.00|
|
| 282 |
+
|