Instructions to use nroggendorff/test-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nroggendorff/test-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nroggendorff/test-it") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nroggendorff/test-it") model = AutoModelForCausalLM.from_pretrained("nroggendorff/test-it", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nroggendorff/test-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nroggendorff/test-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nroggendorff/test-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nroggendorff/test-it
- SGLang
How to use nroggendorff/test-it 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 "nroggendorff/test-it" \ --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": "nroggendorff/test-it", "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 "nroggendorff/test-it" \ --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": "nroggendorff/test-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nroggendorff/test-it with Docker Model Runner:
docker model run hf.co/nroggendorff/test-it
0.4825663803100586
Browse files- tokenizer.json +0 -0
- tokenizer_config.json +4 -4
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
| 40 |
"single_word": false,
|
| 41 |
"special": true
|
| 42 |
},
|
| 43 |
-
"
|
| 44 |
"content": "<|user|>",
|
| 45 |
"lstrip": false,
|
| 46 |
"normalized": false,
|
|
@@ -48,7 +48,7 @@
|
|
| 48 |
"single_word": false,
|
| 49 |
"special": true
|
| 50 |
},
|
| 51 |
-
"
|
| 52 |
"content": "<|bot|>",
|
| 53 |
"lstrip": false,
|
| 54 |
"normalized": false,
|
|
@@ -56,7 +56,7 @@
|
|
| 56 |
"single_word": false,
|
| 57 |
"special": true
|
| 58 |
},
|
| 59 |
-
"
|
| 60 |
"content": "<|end|>",
|
| 61 |
"lstrip": false,
|
| 62 |
"normalized": false,
|
|
@@ -75,7 +75,7 @@
|
|
| 75 |
"clean_up_tokenization_spaces": true,
|
| 76 |
"eos_token": "</s>",
|
| 77 |
"mask_token": "<mask>",
|
| 78 |
-
"max_length":
|
| 79 |
"model_max_length": 1000000000000000019884624838656,
|
| 80 |
"pad_token": "<pad>",
|
| 81 |
"stride": 0,
|
|
|
|
| 40 |
"single_word": false,
|
| 41 |
"special": true
|
| 42 |
},
|
| 43 |
+
"2805": {
|
| 44 |
"content": "<|user|>",
|
| 45 |
"lstrip": false,
|
| 46 |
"normalized": false,
|
|
|
|
| 48 |
"single_word": false,
|
| 49 |
"special": true
|
| 50 |
},
|
| 51 |
+
"2806": {
|
| 52 |
"content": "<|bot|>",
|
| 53 |
"lstrip": false,
|
| 54 |
"normalized": false,
|
|
|
|
| 56 |
"single_word": false,
|
| 57 |
"special": true
|
| 58 |
},
|
| 59 |
+
"2807": {
|
| 60 |
"content": "<|end|>",
|
| 61 |
"lstrip": false,
|
| 62 |
"normalized": false,
|
|
|
|
| 75 |
"clean_up_tokenization_spaces": true,
|
| 76 |
"eos_token": "</s>",
|
| 77 |
"mask_token": "<mask>",
|
| 78 |
+
"max_length": 16,
|
| 79 |
"model_max_length": 1000000000000000019884624838656,
|
| 80 |
"pad_token": "<pad>",
|
| 81 |
"stride": 0,
|