Instructions to use Moatazz/fourthtrial with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Moatazz/fourthtrial with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Moatazz/fourthtrial") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Moatazz/fourthtrial") model = AutoModelForCausalLM.from_pretrained("Moatazz/fourthtrial") 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 Settings
- vLLM
How to use Moatazz/fourthtrial with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Moatazz/fourthtrial" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Moatazz/fourthtrial", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Moatazz/fourthtrial
- SGLang
How to use Moatazz/fourthtrial 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 "Moatazz/fourthtrial" \ --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": "Moatazz/fourthtrial", "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 "Moatazz/fourthtrial" \ --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": "Moatazz/fourthtrial", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Moatazz/fourthtrial with Docker Model Runner:
docker model run hf.co/Moatazz/fourthtrial
Upload tokenizer
Browse files- special_tokens_map.json +3 -4
- tokenizer.json +4 -18
- tokenizer.model +3 -0
- tokenizer_config.json +8 -12
special_tokens_map.json
CHANGED
|
@@ -2,22 +2,21 @@
|
|
| 2 |
"bos_token": {
|
| 3 |
"content": "<s>",
|
| 4 |
"lstrip": false,
|
| 5 |
-
"normalized":
|
| 6 |
"rstrip": false,
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
"content": "</s>",
|
| 11 |
"lstrip": false,
|
| 12 |
-
"normalized":
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
-
"pad_token": "</s>",
|
| 17 |
"unk_token": {
|
| 18 |
"content": "<unk>",
|
| 19 |
"lstrip": false,
|
| 20 |
-
"normalized":
|
| 21 |
"rstrip": false,
|
| 22 |
"single_word": false
|
| 23 |
}
|
|
|
|
| 2 |
"bos_token": {
|
| 3 |
"content": "<s>",
|
| 4 |
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
"rstrip": false,
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
"content": "</s>",
|
| 11 |
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
|
|
|
| 16 |
"unk_token": {
|
| 17 |
"content": "<unk>",
|
| 18 |
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
"rstrip": false,
|
| 21 |
"single_word": false
|
| 22 |
}
|
tokenizer.json
CHANGED
|
@@ -1,11 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
| 4 |
-
"direction": "Right",
|
| 5 |
-
"max_length": 1024,
|
| 6 |
-
"strategy": "LongestFirst",
|
| 7 |
-
"stride": 0
|
| 8 |
-
},
|
| 9 |
"padding": null,
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
|
@@ -14,7 +9,7 @@
|
|
| 14 |
"single_word": false,
|
| 15 |
"lstrip": false,
|
| 16 |
"rstrip": false,
|
| 17 |
-
"normalized":
|
| 18 |
"special": true
|
| 19 |
},
|
| 20 |
{
|
|
@@ -23,7 +18,7 @@
|
|
| 23 |
"single_word": false,
|
| 24 |
"lstrip": false,
|
| 25 |
"rstrip": false,
|
| 26 |
-
"normalized":
|
| 27 |
"special": true
|
| 28 |
},
|
| 29 |
{
|
|
@@ -32,17 +27,8 @@
|
|
| 32 |
"single_word": false,
|
| 33 |
"lstrip": false,
|
| 34 |
"rstrip": false,
|
| 35 |
-
"normalized":
|
| 36 |
"special": true
|
| 37 |
-
},
|
| 38 |
-
{
|
| 39 |
-
"id": 32000,
|
| 40 |
-
"content": "<pad>",
|
| 41 |
-
"single_word": false,
|
| 42 |
-
"lstrip": false,
|
| 43 |
-
"rstrip": false,
|
| 44 |
-
"normalized": true,
|
| 45 |
-
"special": false
|
| 46 |
}
|
| 47 |
],
|
| 48 |
"normalizer": {
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"padding": null,
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
|
|
|
| 9 |
"single_word": false,
|
| 10 |
"lstrip": false,
|
| 11 |
"rstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
"special": true
|
| 14 |
},
|
| 15 |
{
|
|
|
|
| 18 |
"single_word": false,
|
| 19 |
"lstrip": false,
|
| 20 |
"rstrip": false,
|
| 21 |
+
"normalized": false,
|
| 22 |
"special": true
|
| 23 |
},
|
| 24 |
{
|
|
|
|
| 27 |
"single_word": false,
|
| 28 |
"lstrip": false,
|
| 29 |
"rstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
}
|
| 33 |
],
|
| 34 |
"normalizer": {
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
| 3 |
+
size 499723
|
tokenizer_config.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"0": {
|
| 4 |
"content": "<unk>",
|
| 5 |
"lstrip": false,
|
| 6 |
-
"normalized":
|
| 7 |
"rstrip": false,
|
| 8 |
"single_word": false,
|
| 9 |
"special": true
|
|
@@ -11,7 +13,7 @@
|
|
| 11 |
"1": {
|
| 12 |
"content": "<s>",
|
| 13 |
"lstrip": false,
|
| 14 |
-
"normalized":
|
| 15 |
"rstrip": false,
|
| 16 |
"single_word": false,
|
| 17 |
"special": true
|
|
@@ -19,26 +21,20 @@
|
|
| 19 |
"2": {
|
| 20 |
"content": "</s>",
|
| 21 |
"lstrip": false,
|
| 22 |
-
"normalized":
|
| 23 |
"rstrip": false,
|
| 24 |
"single_word": false,
|
| 25 |
"special": true
|
| 26 |
-
},
|
| 27 |
-
"32000": {
|
| 28 |
-
"content": "<pad>",
|
| 29 |
-
"lstrip": false,
|
| 30 |
-
"normalized": true,
|
| 31 |
-
"rstrip": false,
|
| 32 |
-
"single_word": false,
|
| 33 |
-
"special": false
|
| 34 |
}
|
| 35 |
},
|
| 36 |
"bos_token": "<s>",
|
|
|
|
| 37 |
"clean_up_tokenization_spaces": false,
|
| 38 |
"eos_token": "</s>",
|
| 39 |
"legacy": false,
|
| 40 |
"model_max_length": 1000000000000000019884624838656,
|
| 41 |
-
"pad_token":
|
|
|
|
| 42 |
"sp_model_kwargs": {},
|
| 43 |
"tokenizer_class": "LlamaTokenizer",
|
| 44 |
"unk_token": "<unk>",
|
|
|
|
| 1 |
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
| 7 |
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
"rstrip": false,
|
| 10 |
"single_word": false,
|
| 11 |
"special": true
|
|
|
|
| 13 |
"1": {
|
| 14 |
"content": "<s>",
|
| 15 |
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
"rstrip": false,
|
| 18 |
"single_word": false,
|
| 19 |
"special": true
|
|
|
|
| 21 |
"2": {
|
| 22 |
"content": "</s>",
|
| 23 |
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
"rstrip": false,
|
| 26 |
"single_word": false,
|
| 27 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
},
|
| 30 |
"bos_token": "<s>",
|
| 31 |
+
"chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<<SYS>>\\n' + system_message + '\\n<</SYS>>\\n\\n' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}",
|
| 32 |
"clean_up_tokenization_spaces": false,
|
| 33 |
"eos_token": "</s>",
|
| 34 |
"legacy": false,
|
| 35 |
"model_max_length": 1000000000000000019884624838656,
|
| 36 |
+
"pad_token": null,
|
| 37 |
+
"padding_side": "right",
|
| 38 |
"sp_model_kwargs": {},
|
| 39 |
"tokenizer_class": "LlamaTokenizer",
|
| 40 |
"unk_token": "<unk>",
|