Text Generation
Transformers
TensorBoard
Safetensors
GGUF
PEFT
mistral
Trained with AutoTrain
text-generation-inference
conversational
imatrix
Instructions to use Tilo15/cosmic-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tilo15/cosmic-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tilo15/cosmic-2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Tilo15/cosmic-2") model = AutoModelForCausalLM.from_pretrained("Tilo15/cosmic-2", 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]:])) - PEFT
How to use Tilo15/cosmic-2 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Tilo15/cosmic-2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Tilo15/cosmic-2:IQ1_M # Run inference directly in the terminal: llama cli -hf Tilo15/cosmic-2:IQ1_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Tilo15/cosmic-2:IQ1_M # Run inference directly in the terminal: llama cli -hf Tilo15/cosmic-2:IQ1_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Tilo15/cosmic-2:IQ1_M # Run inference directly in the terminal: ./llama-cli -hf Tilo15/cosmic-2:IQ1_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Tilo15/cosmic-2:IQ1_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Tilo15/cosmic-2:IQ1_M
Use Docker
docker model run hf.co/Tilo15/cosmic-2:IQ1_M
- LM Studio
- Jan
- vLLM
How to use Tilo15/cosmic-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tilo15/cosmic-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tilo15/cosmic-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tilo15/cosmic-2:IQ1_M
- SGLang
How to use Tilo15/cosmic-2 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 "Tilo15/cosmic-2" \ --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": "Tilo15/cosmic-2", "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 "Tilo15/cosmic-2" \ --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": "Tilo15/cosmic-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Tilo15/cosmic-2 with Ollama:
ollama run hf.co/Tilo15/cosmic-2:IQ1_M
- Unsloth Studio
How to use Tilo15/cosmic-2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Tilo15/cosmic-2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Tilo15/cosmic-2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Tilo15/cosmic-2 to start chatting
- Docker Model Runner
How to use Tilo15/cosmic-2 with Docker Model Runner:
docker model run hf.co/Tilo15/cosmic-2:IQ1_M
- Lemonade
How to use Tilo15/cosmic-2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Tilo15/cosmic-2:IQ1_M
Run and chat with the model
lemonade run user.cosmic-2-IQ1_M
List all available models
lemonade list
- Atomic Chat
Upload folder using huggingface_hub
Browse files- README.md +46 -0
- adapter_config.json +34 -0
- adapter_model.safetensors +3 -0
- added_tokens.json +4 -0
- runs/Jun24_02-07-04_r-tilo15-autotrain-advanced-z38i0ojy-451f5-0fvyg/events.out.tfevents.1719194937.r-tilo15-autotrain-advanced-z38i0ojy-451f5-0fvyg.85.0 +2 -2
- special_tokens_map.json +30 -0
- tokenizer.json +0 -0
- tokenizer.model +3 -0
- tokenizer_config.json +60 -0
- training_args.bin +3 -0
- training_params.json +48 -0
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- autotrain
|
| 4 |
+
- text-generation-inference
|
| 5 |
+
- text-generation
|
| 6 |
+
- peft
|
| 7 |
+
library_name: transformers
|
| 8 |
+
base_model: Tilo15/big-text-3
|
| 9 |
+
widget:
|
| 10 |
+
- messages:
|
| 11 |
+
- role: user
|
| 12 |
+
content: What is your favorite condiment?
|
| 13 |
+
license: other
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Model Trained Using AutoTrain
|
| 17 |
+
|
| 18 |
+
This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
|
| 19 |
+
|
| 20 |
+
# Usage
|
| 21 |
+
|
| 22 |
+
```python
|
| 23 |
+
|
| 24 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 25 |
+
|
| 26 |
+
model_path = "PATH_TO_THIS_REPO"
|
| 27 |
+
|
| 28 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 29 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 30 |
+
model_path,
|
| 31 |
+
device_map="auto",
|
| 32 |
+
torch_dtype='auto'
|
| 33 |
+
).eval()
|
| 34 |
+
|
| 35 |
+
# Prompt content: "hi"
|
| 36 |
+
messages = [
|
| 37 |
+
{"role": "user", "content": "hi"}
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
|
| 41 |
+
output_ids = model.generate(input_ids.to('cuda'))
|
| 42 |
+
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
|
| 43 |
+
|
| 44 |
+
# Model response: "Hello! How can I assist you today?"
|
| 45 |
+
print(response)
|
| 46 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "Tilo15/big-text-3",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"fan_in_fan_out": false,
|
| 7 |
+
"inference_mode": true,
|
| 8 |
+
"init_lora_weights": true,
|
| 9 |
+
"layer_replication": null,
|
| 10 |
+
"layers_pattern": null,
|
| 11 |
+
"layers_to_transform": null,
|
| 12 |
+
"loftq_config": {},
|
| 13 |
+
"lora_alpha": 32,
|
| 14 |
+
"lora_dropout": 0.05,
|
| 15 |
+
"megatron_config": null,
|
| 16 |
+
"megatron_core": "megatron.core",
|
| 17 |
+
"modules_to_save": null,
|
| 18 |
+
"peft_type": "LORA",
|
| 19 |
+
"r": 16,
|
| 20 |
+
"rank_pattern": {},
|
| 21 |
+
"revision": "unsloth",
|
| 22 |
+
"target_modules": [
|
| 23 |
+
"gate_proj",
|
| 24 |
+
"down_proj",
|
| 25 |
+
"v_proj",
|
| 26 |
+
"up_proj",
|
| 27 |
+
"o_proj",
|
| 28 |
+
"k_proj",
|
| 29 |
+
"q_proj"
|
| 30 |
+
],
|
| 31 |
+
"task_type": "CAUSAL_LM",
|
| 32 |
+
"use_dora": false,
|
| 33 |
+
"use_rslora": false
|
| 34 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8058a97c6bd1f8ee7dc9c260d5b9f53327af5c02eca45bc874cf41c087b5fb78
|
| 3 |
+
size 167832240
|
added_tokens.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<|im_end|>": 32000,
|
| 3 |
+
"<|im_start|>": 32001
|
| 4 |
+
}
|
runs/Jun24_02-07-04_r-tilo15-autotrain-advanced-z38i0ojy-451f5-0fvyg/events.out.tfevents.1719194937.r-tilo15-autotrain-advanced-z38i0ojy-451f5-0fvyg.85.0
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:36b984b8bb30419717771323f4cde4c24199dc21b3b1d82d749d5439849b2ec5
|
| 3 |
+
size 98713
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 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": "<|im_end|>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "</s>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"unk_token": {
|
| 24 |
+
"content": "<unk>",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
}
|
| 30 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dadfd56d766715c61d2ef780a525ab43b8e6da4de6865bda3d95fdef5e134055
|
| 3 |
+
size 493443
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"add_prefix_space": true,
|
| 5 |
+
"added_tokens_decoder": {
|
| 6 |
+
"0": {
|
| 7 |
+
"content": "<unk>",
|
| 8 |
+
"lstrip": false,
|
| 9 |
+
"normalized": false,
|
| 10 |
+
"rstrip": false,
|
| 11 |
+
"single_word": false,
|
| 12 |
+
"special": true
|
| 13 |
+
},
|
| 14 |
+
"1": {
|
| 15 |
+
"content": "<s>",
|
| 16 |
+
"lstrip": false,
|
| 17 |
+
"normalized": false,
|
| 18 |
+
"rstrip": false,
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"special": true
|
| 21 |
+
},
|
| 22 |
+
"2": {
|
| 23 |
+
"content": "</s>",
|
| 24 |
+
"lstrip": false,
|
| 25 |
+
"normalized": false,
|
| 26 |
+
"rstrip": false,
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"special": true
|
| 29 |
+
},
|
| 30 |
+
"32000": {
|
| 31 |
+
"content": "<|im_end|>",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"special": true
|
| 37 |
+
},
|
| 38 |
+
"32001": {
|
| 39 |
+
"content": "<|im_start|>",
|
| 40 |
+
"lstrip": false,
|
| 41 |
+
"normalized": false,
|
| 42 |
+
"rstrip": false,
|
| 43 |
+
"single_word": false,
|
| 44 |
+
"special": false
|
| 45 |
+
}
|
| 46 |
+
},
|
| 47 |
+
"bos_token": "<s>",
|
| 48 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{{ bos_token }}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 49 |
+
"clean_up_tokenization_spaces": false,
|
| 50 |
+
"eos_token": "<|im_end|>",
|
| 51 |
+
"legacy": true,
|
| 52 |
+
"model_max_length": 2048,
|
| 53 |
+
"pad_token": "</s>",
|
| 54 |
+
"sp_model_kwargs": {},
|
| 55 |
+
"spaces_between_special_tokens": false,
|
| 56 |
+
"tokenizer_class": "LlamaTokenizer",
|
| 57 |
+
"unk_token": "<unk>",
|
| 58 |
+
"use_default_system_prompt": false,
|
| 59 |
+
"use_fast": true
|
| 60 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a587eb8838957a3293f0793dfb8ad0a46ab31efe6f430970a2f506015d88359
|
| 3 |
+
size 5432
|
training_params.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "Tilo15/big-text-3",
|
| 3 |
+
"project_name": "cosmic-2",
|
| 4 |
+
"data_path": "cosmic-2/autotrain-data",
|
| 5 |
+
"train_split": "train",
|
| 6 |
+
"valid_split": null,
|
| 7 |
+
"add_eos_token": true,
|
| 8 |
+
"block_size": 1024,
|
| 9 |
+
"model_max_length": 2048,
|
| 10 |
+
"padding": "right",
|
| 11 |
+
"trainer": "sft",
|
| 12 |
+
"use_flash_attention_2": false,
|
| 13 |
+
"log": "tensorboard",
|
| 14 |
+
"disable_gradient_checkpointing": false,
|
| 15 |
+
"logging_steps": -1,
|
| 16 |
+
"eval_strategy": "epoch",
|
| 17 |
+
"save_total_limit": 1,
|
| 18 |
+
"auto_find_batch_size": false,
|
| 19 |
+
"mixed_precision": "fp16",
|
| 20 |
+
"lr": 3e-05,
|
| 21 |
+
"epochs": 3,
|
| 22 |
+
"batch_size": 2,
|
| 23 |
+
"warmup_ratio": 0.1,
|
| 24 |
+
"gradient_accumulation": 4,
|
| 25 |
+
"optimizer": "adamw_torch",
|
| 26 |
+
"scheduler": "linear",
|
| 27 |
+
"weight_decay": 0.0,
|
| 28 |
+
"max_grad_norm": 1.0,
|
| 29 |
+
"seed": 42,
|
| 30 |
+
"chat_template": "none",
|
| 31 |
+
"quantization": "int4",
|
| 32 |
+
"target_modules": "all-linear",
|
| 33 |
+
"merge_adapter": false,
|
| 34 |
+
"peft": true,
|
| 35 |
+
"lora_r": 16,
|
| 36 |
+
"lora_alpha": 32,
|
| 37 |
+
"lora_dropout": 0.05,
|
| 38 |
+
"model_ref": null,
|
| 39 |
+
"dpo_beta": 0.1,
|
| 40 |
+
"max_prompt_length": 128,
|
| 41 |
+
"max_completion_length": null,
|
| 42 |
+
"prompt_text_column": "autotrain_prompt",
|
| 43 |
+
"text_column": "autotrain_text",
|
| 44 |
+
"rejected_text_column": "autotrain_rejected_text",
|
| 45 |
+
"push_to_hub": true,
|
| 46 |
+
"username": "Tilo15",
|
| 47 |
+
"unsloth": true
|
| 48 |
+
}
|