Text Generation
Transformers
Safetensors
llama
mergekit
Merge
conversational
text-generation-inference
Instructions to use Sumail/Xnova2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sumail/Xnova2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sumail/Xnova2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sumail/Xnova2") model = AutoModelForCausalLM.from_pretrained("Sumail/Xnova2", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sumail/Xnova2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sumail/Xnova2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sumail/Xnova2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sumail/Xnova2
- SGLang
How to use Sumail/Xnova2 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 "Sumail/Xnova2" \ --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": "Sumail/Xnova2", "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 "Sumail/Xnova2" \ --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": "Sumail/Xnova2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Sumail/Xnova2 with Docker Model Runner:
docker model run hf.co/Sumail/Xnova2
Upload folder using huggingface_hub
Browse files- README.md +7 -7
- config.json +1 -1
- mergekit_config.yml +3 -3
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- tokenizer.json +7 -2
- tokenizer_config.json +5 -1
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
base_model:
|
| 3 |
-
-
|
| 4 |
-
-
|
| 5 |
library_name: transformers
|
| 6 |
tags:
|
| 7 |
- mergekit
|
|
@@ -20,8 +20,8 @@ This model was merged using the SLERP merge method.
|
|
| 20 |
### Models Merged
|
| 21 |
|
| 22 |
The following models were included in the merge:
|
| 23 |
-
* [
|
| 24 |
-
* [
|
| 25 |
|
| 26 |
### Configuration
|
| 27 |
|
|
@@ -31,12 +31,12 @@ The following YAML configuration was used to produce this model:
|
|
| 31 |
|
| 32 |
slices:
|
| 33 |
- sources:
|
| 34 |
-
- model:
|
| 35 |
layer_range: [0, 32]
|
| 36 |
-
- model:
|
| 37 |
layer_range: [0, 32]
|
| 38 |
merge_method: slerp
|
| 39 |
-
base_model:
|
| 40 |
parameters:
|
| 41 |
t:
|
| 42 |
- filter: self_attn
|
|
|
|
| 1 |
---
|
| 2 |
base_model:
|
| 3 |
+
- kiwikiw/llama5
|
| 4 |
+
- tomaszki/llama-16
|
| 5 |
library_name: transformers
|
| 6 |
tags:
|
| 7 |
- mergekit
|
|
|
|
| 20 |
### Models Merged
|
| 21 |
|
| 22 |
The following models were included in the merge:
|
| 23 |
+
* [kiwikiw/llama5](https://huggingface.co/kiwikiw/llama5)
|
| 24 |
+
* [tomaszki/llama-16](https://huggingface.co/tomaszki/llama-16)
|
| 25 |
|
| 26 |
### Configuration
|
| 27 |
|
|
|
|
| 31 |
|
| 32 |
slices:
|
| 33 |
- sources:
|
| 34 |
+
- model: kiwikiw/llama5
|
| 35 |
layer_range: [0, 32]
|
| 36 |
+
- model: tomaszki/llama-16
|
| 37 |
layer_range: [0, 32]
|
| 38 |
merge_method: slerp
|
| 39 |
+
base_model: kiwikiw/llama5
|
| 40 |
parameters:
|
| 41 |
t:
|
| 42 |
- filter: self_attn
|
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "kiwikiw/llama5",
|
| 3 |
"architectures": [
|
| 4 |
"LlamaForCausalLM"
|
| 5 |
],
|
mergekit_config.yml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
|
| 2 |
slices:
|
| 3 |
- sources:
|
| 4 |
-
- model:
|
| 5 |
layer_range: [0, 32]
|
| 6 |
-
- model:
|
| 7 |
layer_range: [0, 32]
|
| 8 |
merge_method: slerp
|
| 9 |
-
base_model:
|
| 10 |
parameters:
|
| 11 |
t:
|
| 12 |
- filter: self_attn
|
|
|
|
| 1 |
|
| 2 |
slices:
|
| 3 |
- sources:
|
| 4 |
+
- model: kiwikiw/llama5
|
| 5 |
layer_range: [0, 32]
|
| 6 |
+
- model: tomaszki/llama-16
|
| 7 |
layer_range: [0, 32]
|
| 8 |
merge_method: slerp
|
| 9 |
+
base_model: kiwikiw/llama5
|
| 10 |
parameters:
|
| 11 |
t:
|
| 12 |
- filter: self_attn
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 9953405736
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b54980ca6e010c15f4f0bf2d43c60e648c8c66682bdf6e9337c603afad34ef9
|
| 3 |
size 9953405736
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6107150624
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09cff084962328b1413ae3d3ade066e074a0b753e40aa296fb315861b6b02d1e
|
| 3 |
size 6107150624
|
tokenizer.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
-
"truncation":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"padding": null,
|
| 5 |
"added_tokens": [
|
| 6 |
{
|
|
@@ -2407,7 +2412,7 @@
|
|
| 2407 |
"end_of_word_suffix": null,
|
| 2408 |
"fuse_unk": false,
|
| 2409 |
"byte_fallback": false,
|
| 2410 |
-
"ignore_merges":
|
| 2411 |
"vocab": {
|
| 2412 |
"!": 0,
|
| 2413 |
"\"": 1,
|
|
|
|
| 1 |
{
|
| 2 |
"version": "1.0",
|
| 3 |
+
"truncation": {
|
| 4 |
+
"direction": "Right",
|
| 5 |
+
"max_length": 2048,
|
| 6 |
+
"strategy": "LongestFirst",
|
| 7 |
+
"stride": 0
|
| 8 |
+
},
|
| 9 |
"padding": null,
|
| 10 |
"added_tokens": [
|
| 11 |
{
|
|
|
|
| 2412 |
"end_of_word_suffix": null,
|
| 2413 |
"fuse_unk": false,
|
| 2414 |
"byte_fallback": false,
|
| 2415 |
+
"ignore_merges": true,
|
| 2416 |
"vocab": {
|
| 2417 |
"!": 0,
|
| 2418 |
"\"": 1,
|
tokenizer_config.json
CHANGED
|
@@ -2053,11 +2053,15 @@
|
|
| 2053 |
"chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{% endif %}",
|
| 2054 |
"clean_up_tokenization_spaces": true,
|
| 2055 |
"eos_token": "<|end_of_text|>",
|
|
|
|
| 2056 |
"model_input_names": [
|
| 2057 |
"input_ids",
|
| 2058 |
"attention_mask"
|
| 2059 |
],
|
| 2060 |
"model_max_length": 1000000000000000019884624838656,
|
| 2061 |
"pad_token": "<|end_of_text|>",
|
| 2062 |
-
"
|
|
|
|
|
|
|
|
|
|
| 2063 |
}
|
|
|
|
| 2053 |
"chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{% endif %}",
|
| 2054 |
"clean_up_tokenization_spaces": true,
|
| 2055 |
"eos_token": "<|end_of_text|>",
|
| 2056 |
+
"max_length": 2048,
|
| 2057 |
"model_input_names": [
|
| 2058 |
"input_ids",
|
| 2059 |
"attention_mask"
|
| 2060 |
],
|
| 2061 |
"model_max_length": 1000000000000000019884624838656,
|
| 2062 |
"pad_token": "<|end_of_text|>",
|
| 2063 |
+
"stride": 0,
|
| 2064 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 2065 |
+
"truncation_side": "right",
|
| 2066 |
+
"truncation_strategy": "longest_first"
|
| 2067 |
}
|