Instructions to use IndexTeam/Index-1.9B-Constant-LR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IndexTeam/Index-1.9B-Constant-LR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IndexTeam/Index-1.9B-Constant-LR", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IndexTeam/Index-1.9B-Constant-LR", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IndexTeam/Index-1.9B-Constant-LR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IndexTeam/Index-1.9B-Constant-LR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IndexTeam/Index-1.9B-Constant-LR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IndexTeam/Index-1.9B-Constant-LR
- SGLang
How to use IndexTeam/Index-1.9B-Constant-LR 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 "IndexTeam/Index-1.9B-Constant-LR" \ --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": "IndexTeam/Index-1.9B-Constant-LR", "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 "IndexTeam/Index-1.9B-Constant-LR" \ --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": "IndexTeam/Index-1.9B-Constant-LR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IndexTeam/Index-1.9B-Constant-LR with Docker Model Runner:
docker model run hf.co/IndexTeam/Index-1.9B-Constant-LR
Add pipeline tag, library name, and paper link to model card
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
| 2 |
license: other
|
| 3 |
license_name: license
|
| 4 |
license_link: LICENSE
|
|
|
|
|
|
|
| 5 |
---
|
|
|
|
| 6 |
<div align="center">
|
| 7 |
<h1>
|
| 8 |
Index-1.9B-Constant-LR
|
|
@@ -12,7 +15,9 @@ license_link: LICENSE
|
|
| 12 |
## Model Introduction
|
| 13 |
This repository Index-1.9B-Constant-LR is the checkpoint file of the [Index-1.9B](https://huggingface.co/IndexTeam/Index-1.9B) base model before decay training, which is provided for everyone to conduct research on downstream tasks.
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
## Evaluation Results
|
| 18 |
Here we add the evaluation of the general understanding ability of the Index-1.9B-Constant-LR model
|
|
@@ -23,3 +28,51 @@ Here we add the evaluation of the general understanding ability of the Index-1.9
|
|
| 23 |
|**Index-1.9B**|**64.92** |**69.93**|52.53|57.01|52.79|80.69|65.15|81.35|
|
| 24 |
|
| 25 |
Evaluation code is based on [OpenCompass](https://github.com/open-compass/opencompass) with compatibility modifications. See the [evaluate](./evaluate/) folder for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: other
|
| 3 |
license_name: license
|
| 4 |
license_link: LICENSE
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
---
|
| 8 |
+
|
| 9 |
<div align="center">
|
| 10 |
<h1>
|
| 11 |
Index-1.9B-Constant-LR
|
|
|
|
| 15 |
## Model Introduction
|
| 16 |
This repository Index-1.9B-Constant-LR is the checkpoint file of the [Index-1.9B](https://huggingface.co/IndexTeam/Index-1.9B) base model before decay training, which is provided for everyone to conduct research on downstream tasks.
|
| 17 |
|
| 18 |
+
It is presented in the paper [Index SLM Technical Report](https://huggingface.co/papers/2607.09885).
|
| 19 |
+
|
| 20 |
+
For more details, see our [GitHub](https://github.com/bilibili/Index-1.9B) and [Index-1.9B Technical Report](https://github.com/bilibili/Index-1.9B/blob/main/Index-1.9B%20%E6%8A%80%E6%9C%AF%E6%8A%A5%E5%91%8A.pdf).
|
| 21 |
|
| 22 |
## Evaluation Results
|
| 23 |
Here we add the evaluation of the general understanding ability of the Index-1.9B-Constant-LR model
|
|
|
|
| 28 |
|**Index-1.9B**|**64.92** |**69.93**|52.53|57.01|52.79|80.69|65.15|81.35|
|
| 29 |
|
| 30 |
Evaluation code is based on [OpenCompass](https://github.com/open-compass/opencompass) with compatibility modifications. See the [evaluate](./evaluate/) folder for details.
|
| 31 |
+
|
| 32 |
+
## How to Use
|
| 33 |
+
|
| 34 |
+
You can load this model using `transformers` with the following code snippet:
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
import argparse
|
| 38 |
+
from transformers import AutoTokenizer, pipeline
|
| 39 |
+
|
| 40 |
+
# Attention! The directory must not contain "." and can be replaced with "_".
|
| 41 |
+
parser = argparse.ArgumentParser()
|
| 42 |
+
parser.add_argument('--model_path', default="IndexTeam/Index-1.9B-Constant-LR", type=str, help="")
|
| 43 |
+
parser.add_argument('--device', default="cpu", type=str, help="") # also could be "cuda" or "mps" for Apple silicon
|
| 44 |
+
args = parser.parse_args()
|
| 45 |
+
|
| 46 |
+
tokenizer = AutoTokenizer.from_pretrained(args.model_path, trust_remote_code=True)
|
| 47 |
+
generator = pipeline("text-generation",
|
| 48 |
+
model=args.model_path,
|
| 49 |
+
tokenizer=tokenizer, trust_remote_code=True,
|
| 50 |
+
device=args.device)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
system_message = "你是由哔哩哔哩自主研发的大语言模型,名为“Index”。你能够根据用户传入的信息,帮助用户完成指定的任务,并生成恰当的、符合要求的回复。"
|
| 54 |
+
query = "续写 天不生我金坷垃"
|
| 55 |
+
model_input = []
|
| 56 |
+
model_input.append({"role": "system", "content": system_message})
|
| 57 |
+
model_input.append({"role": "user", "content": query})
|
| 58 |
+
|
| 59 |
+
model_output = generator(model_input, max_new_tokens=300, top_k=5, top_p=0.8, temperature=0.3, repetition_penalty=1.1, do_sample=True)
|
| 60 |
+
|
| 61 |
+
print('User:', query)
|
| 62 |
+
print('Model:', model_output)
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Model Open Source License
|
| 66 |
+
|
| 67 |
+
Using the source code from this repository requires compliance with the [Apache-2.0](LICENSE). The use of the Index-1.9B model weights requires compliance with the [INDEX_MODEL_LICENSE](INDEX_MODEL_LICENSE).
|
| 68 |
+
|
| 69 |
+
The Index-1.9B model weights are **fully open** for academic research and support **free commercial use**.
|
| 70 |
+
|
| 71 |
+
## Citation
|
| 72 |
+
|
| 73 |
+
```bibtex
|
| 74 |
+
@article{Index,
|
| 75 |
+
title={Index1.9B Technical Report},
|
| 76 |
+
year={2024}
|
| 77 |
+
}
|
| 78 |
+
```
|