Instructions to use plison/graph-retrieval with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use plison/graph-retrieval with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="plison/graph-retrieval") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("plison/graph-retrieval") model = AutoModelForCausalLM.from_pretrained("plison/graph-retrieval") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use plison/graph-retrieval with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "plison/graph-retrieval" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "plison/graph-retrieval", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/plison/graph-retrieval
- SGLang
How to use plison/graph-retrieval 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 "plison/graph-retrieval" \ --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": "plison/graph-retrieval", "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 "plison/graph-retrieval" \ --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": "plison/graph-retrieval", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use plison/graph-retrieval with Docker Model Runner:
docker model run hf.co/plison/graph-retrieval
Upload tokenizer
Browse files- special_tokens_map.json +1 -1
- tokenizer.json +2 -2
- tokenizer_config.json +1 -5
special_tokens_map.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"single_word": false
|
| 19 |
},
|
| 20 |
"pad_token": {
|
| 21 |
-
"content": "<
|
| 22 |
"lstrip": false,
|
| 23 |
"normalized": false,
|
| 24 |
"rstrip": false,
|
|
|
|
| 18 |
"single_word": false
|
| 19 |
},
|
| 20 |
"pad_token": {
|
| 21 |
+
"content": "<pad>",
|
| 22 |
"lstrip": false,
|
| 23 |
"normalized": false,
|
| 24 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7da53ca29fb16f6b2489482fc0bc6a394162cdab14d12764a1755ebc583fea79
|
| 3 |
+
size 17518525
|
tokenizer_config.json
CHANGED
|
@@ -1747,15 +1747,11 @@
|
|
| 1747 |
"chat_template": "{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}",
|
| 1748 |
"clean_up_tokenization_spaces": false,
|
| 1749 |
"eos_token": "<eos>",
|
| 1750 |
-
"max_length": 3500,
|
| 1751 |
"model_max_length": 1000000000000000019884624838656,
|
| 1752 |
-
"pad_token": "<
|
| 1753 |
"sp_model_kwargs": {},
|
| 1754 |
"spaces_between_special_tokens": false,
|
| 1755 |
-
"stride": 0,
|
| 1756 |
"tokenizer_class": "GemmaTokenizer",
|
| 1757 |
-
"truncation_side": "right",
|
| 1758 |
-
"truncation_strategy": "longest_first",
|
| 1759 |
"unk_token": "<unk>",
|
| 1760 |
"use_default_system_prompt": false
|
| 1761 |
}
|
|
|
|
| 1747 |
"chat_template": "{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '<start_of_turn>' + role + '\n' + message['content'] | trim + '<end_of_turn>\n' }}{% endfor %}{% if add_generation_prompt %}{{'<start_of_turn>model\n'}}{% endif %}",
|
| 1748 |
"clean_up_tokenization_spaces": false,
|
| 1749 |
"eos_token": "<eos>",
|
|
|
|
| 1750 |
"model_max_length": 1000000000000000019884624838656,
|
| 1751 |
+
"pad_token": "<pad>",
|
| 1752 |
"sp_model_kwargs": {},
|
| 1753 |
"spaces_between_special_tokens": false,
|
|
|
|
| 1754 |
"tokenizer_class": "GemmaTokenizer",
|
|
|
|
|
|
|
| 1755 |
"unk_token": "<unk>",
|
| 1756 |
"use_default_system_prompt": false
|
| 1757 |
}
|