Instructions to use IndexTeam/Index-1.9B-Chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IndexTeam/Index-1.9B-Chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IndexTeam/Index-1.9B-Chat", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IndexTeam/Index-1.9B-Chat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IndexTeam/Index-1.9B-Chat 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-Chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IndexTeam/Index-1.9B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IndexTeam/Index-1.9B-Chat
- SGLang
How to use IndexTeam/Index-1.9B-Chat 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-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IndexTeam/Index-1.9B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-Chat" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IndexTeam/Index-1.9B-Chat", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IndexTeam/Index-1.9B-Chat with Docker Model Runner:
docker model run hf.co/IndexTeam/Index-1.9B-Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -40,7 +40,7 @@ model = AutoModelForCausalLM.from_pretrained(args.model_path, torch_dtype=torch.
|
|
| 40 |
model = model.eval()
|
| 41 |
print('model loaded', args.model_path, model.device)
|
| 42 |
|
| 43 |
-
system_message = "你是由哔哩哔哩
|
| 44 |
query = "续写 天不生我金坷垃"
|
| 45 |
model_input = []
|
| 46 |
model_input.append({"role": "system", "content": system_message})
|
|
|
|
| 40 |
model = model.eval()
|
| 41 |
print('model loaded', args.model_path, model.device)
|
| 42 |
|
| 43 |
+
system_message = "你是由哔哩哔哩自主研发的大语言模型,名为“Index”。你能够根据用户传入的信息,帮助用户完成指定的任务,并生成恰当的、符合要求的回复。"
|
| 44 |
query = "续写 天不生我金坷垃"
|
| 45 |
model_input = []
|
| 46 |
model_input.append({"role": "system", "content": system_message})
|