Text Generation
Transformers
Safetensors
lfm2
text-editing
rewriting
paraphrasing
instruct
conversational
Instructions to use appvoid/cloud-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use appvoid/cloud-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="appvoid/cloud-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("appvoid/cloud-v1") model = AutoModelForCausalLM.from_pretrained("appvoid/cloud-v1", 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 appvoid/cloud-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "appvoid/cloud-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "appvoid/cloud-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/appvoid/cloud-v1
- SGLang
How to use appvoid/cloud-v1 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 "appvoid/cloud-v1" \ --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": "appvoid/cloud-v1", "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 "appvoid/cloud-v1" \ --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": "appvoid/cloud-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use appvoid/cloud-v1 with Docker Model Runner:
docker model run hf.co/appvoid/cloud-v1
Upload 7 files
Browse files- README.md +44 -0
- chat_template.jinja +64 -0
- config.json +61 -0
- generation_config.json +9 -0
- model.safetensors +3 -0
- tokenizer_config.json +22 -0
- training_args.bin +3 -0
README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: LiquidAI/LFM2.5-350M
|
| 3 |
+
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- text-generation
|
| 6 |
+
- text-editing
|
| 7 |
+
- rewriting
|
| 8 |
+
- paraphrasing
|
| 9 |
+
- instruct
|
| 10 |
+
private: true
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# graphite-001
|
| 14 |
+
|
| 15 |
+
Private fine-tune of `LiquidAI/LFM2.5-350M` on `appvoid/rewrite4`.
|
| 16 |
+
|
| 17 |
+
## Training
|
| 18 |
+
|
| 19 |
+
- Method: full supervised fine-tuning
|
| 20 |
+
- Epochs: 1
|
| 21 |
+
- Dataset fields: `instruction`, `text`, `output`
|
| 22 |
+
- Format: native chat template from the base tokenizer
|
| 23 |
+
- Train rows used: 83059
|
| 24 |
+
|
| 25 |
+
## Prompt format
|
| 26 |
+
|
| 27 |
+
The model was trained with one user message:
|
| 28 |
+
|
| 29 |
+
```text
|
| 30 |
+
{instruction}
|
| 31 |
+
|
| 32 |
+
Text:
|
| 33 |
+
{text}
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
The assistant message contains only:
|
| 37 |
+
|
| 38 |
+
```text
|
| 39 |
+
{output}
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Intended use
|
| 43 |
+
|
| 44 |
+
Text rewriting, paraphrasing, tone transfer, grammar-style editing, and instruction-following text transformations.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}
|
| 2 |
+
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
| 3 |
+
{%- set ns = namespace(system_prompt="") -%}
|
| 4 |
+
{%- if messages[0]["role"] == "system" -%}
|
| 5 |
+
{%- set sys_content = messages[0]["content"] -%}
|
| 6 |
+
{%- if sys_content is not string -%}
|
| 7 |
+
{%- for item in sys_content -%}
|
| 8 |
+
{%- if item["type"] == "text" -%}
|
| 9 |
+
{%- set ns.system_prompt = ns.system_prompt + item["text"] -%}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
{%- endfor -%}
|
| 12 |
+
{%- else -%}
|
| 13 |
+
{%- set ns.system_prompt = sys_content -%}
|
| 14 |
+
{%- endif -%}
|
| 15 |
+
{%- set messages = messages[1:] -%}
|
| 16 |
+
{%- endif -%}
|
| 17 |
+
{%- if tools -%}
|
| 18 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
| 19 |
+
{%- for tool in tools -%}
|
| 20 |
+
{%- if tool is not string -%}
|
| 21 |
+
{%- set tool = tool | tojson -%}
|
| 22 |
+
{%- endif -%}
|
| 23 |
+
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
| 24 |
+
{%- if not loop.last -%}
|
| 25 |
+
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
| 26 |
+
{%- endif -%}
|
| 27 |
+
{%- endfor -%}
|
| 28 |
+
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
| 29 |
+
{%- endif -%}
|
| 30 |
+
{%- if ns.system_prompt -%}
|
| 31 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 32 |
+
{%- endif -%}
|
| 33 |
+
{%- set ns.last_assistant_index = -1 -%}
|
| 34 |
+
{%- for message in messages -%}
|
| 35 |
+
{%- if message["role"] == "assistant" -%}
|
| 36 |
+
{%- set ns.last_assistant_index = loop.index0 -%}
|
| 37 |
+
{%- endif -%}
|
| 38 |
+
{%- endfor -%}
|
| 39 |
+
{%- for message in messages -%}
|
| 40 |
+
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 41 |
+
{%- set content = message["content"] -%}
|
| 42 |
+
{%- if content is not string -%}
|
| 43 |
+
{%- set ns.content = "" -%}
|
| 44 |
+
{%- for item in content -%}
|
| 45 |
+
{%- if item["type"] == "image" -%}
|
| 46 |
+
{%- set ns.content = ns.content + "<image>" -%}
|
| 47 |
+
{%- elif item["type"] == "text" -%}
|
| 48 |
+
{%- set ns.content = ns.content + item["text"] -%}
|
| 49 |
+
{%- else -%}
|
| 50 |
+
{%- set ns.content = ns.content + item | tojson -%}
|
| 51 |
+
{%- endif -%}
|
| 52 |
+
{%- endfor -%}
|
| 53 |
+
{%- set content = ns.content -%}
|
| 54 |
+
{%- endif -%}
|
| 55 |
+
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 56 |
+
{%- if "</think>" in content -%}
|
| 57 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 58 |
+
{%- endif -%}
|
| 59 |
+
{%- endif -%}
|
| 60 |
+
{{- content + "<|im_end|>\n" -}}
|
| 61 |
+
{%- endfor -%}
|
| 62 |
+
{%- if add_generation_prompt -%}
|
| 63 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 64 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"block_auto_adjust_ff_dim": true,
|
| 6 |
+
"block_dim": 1024,
|
| 7 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 8 |
+
"block_mlp_init_scale": 1.0,
|
| 9 |
+
"block_multiple_of": 256,
|
| 10 |
+
"block_norm_eps": 1e-05,
|
| 11 |
+
"block_out_init_scale": 1.0,
|
| 12 |
+
"block_use_swiglu": true,
|
| 13 |
+
"block_use_xavier_init": true,
|
| 14 |
+
"bos_token_id": 1,
|
| 15 |
+
"conv_L_cache": 3,
|
| 16 |
+
"conv_bias": false,
|
| 17 |
+
"conv_dim": 1024,
|
| 18 |
+
"conv_use_xavier_init": true,
|
| 19 |
+
"dtype": "bfloat16",
|
| 20 |
+
"eos_token_id": 7,
|
| 21 |
+
"full_attn_idxs": null,
|
| 22 |
+
"hidden_size": 1024,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 6656,
|
| 25 |
+
"layer_types": [
|
| 26 |
+
"conv",
|
| 27 |
+
"conv",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"conv",
|
| 30 |
+
"conv",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"conv",
|
| 33 |
+
"conv",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"conv",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"conv",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"conv",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"conv"
|
| 42 |
+
],
|
| 43 |
+
"max_position_embeddings": 128000,
|
| 44 |
+
"model_type": "lfm2",
|
| 45 |
+
"norm_eps": 1e-05,
|
| 46 |
+
"num_attention_heads": 16,
|
| 47 |
+
"num_heads": 16,
|
| 48 |
+
"num_hidden_layers": 16,
|
| 49 |
+
"num_key_value_heads": 8,
|
| 50 |
+
"output_router_logits": true,
|
| 51 |
+
"pad_token_id": 0,
|
| 52 |
+
"rope_parameters": {
|
| 53 |
+
"rope_theta": 1000000.0,
|
| 54 |
+
"rope_type": "default"
|
| 55 |
+
},
|
| 56 |
+
"tie_word_embeddings": true,
|
| 57 |
+
"transformers_version": "5.13.1",
|
| 58 |
+
"use_cache": false,
|
| 59 |
+
"use_pos_enc": true,
|
| 60 |
+
"vocab_size": 65536
|
| 61 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
7
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "5.13.1"
|
| 9 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:49d935d52bb801386fafa5b55488f28eeaa2eb43aedee13df531f02ce4683072
|
| 3 |
+
size 708984464
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|startoftext|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|im_end|>",
|
| 6 |
+
"extra_special_tokens": [],
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"legacy": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"model_input_names": [
|
| 11 |
+
"input_ids",
|
| 12 |
+
"attention_mask"
|
| 13 |
+
],
|
| 14 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 15 |
+
"model_specific_special_tokens": {},
|
| 16 |
+
"pad_token": "<|pad|>",
|
| 17 |
+
"sp_model_kwargs": {},
|
| 18 |
+
"spaces_between_special_tokens": false,
|
| 19 |
+
"tokenizer_class": "TokenizersBackend",
|
| 20 |
+
"use_default_system_prompt": false,
|
| 21 |
+
"use_fast": true
|
| 22 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4817e895368082d258ea4022ffe45a4c9ce93faf981e6d81c01499feb368415
|
| 3 |
+
size 5201
|