Text Generation
Transformers
Safetensors
English
llama
astheral
instruct
qlora
conversational
text-generation-inference
Instructions to use SEE7/Astheral with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SEE7/Astheral with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SEE7/Astheral") 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("SEE7/Astheral") model = AutoModelForCausalLM.from_pretrained("SEE7/Astheral", 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 SEE7/Astheral with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SEE7/Astheral" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SEE7/Astheral", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SEE7/Astheral
- SGLang
How to use SEE7/Astheral 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 "SEE7/Astheral" \ --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": "SEE7/Astheral", "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 "SEE7/Astheral" \ --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": "SEE7/Astheral", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SEE7/Astheral with Docker Model Runner:
docker model run hf.co/SEE7/Astheral
Present Astheral v2 capabilities, measured comparisons and deterministic inference defaults
Browse files- README.md +54 -40
- artifact_manifest.json +6 -6
- generation_config.json +7 -5
- inference.py +8 -2
README.md
CHANGED
|
@@ -12,47 +12,61 @@ tags:
|
|
| 12 |
- llama
|
| 13 |
- instruct
|
| 14 |
- reasoning
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# Astheral
|
| 18 |
|
| 19 |
-
Built with Llama. Astheral is SEE7's 8.03B assistant
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
- llama
|
| 13 |
- instruct
|
| 14 |
- reasoning
|
| 15 |
+
- qlora
|
| 16 |
---
|
| 17 |
|
| 18 |
# Astheral
|
| 19 |
|
| 20 |
+
**Built with Llama.** Astheral is SEE7's 8.03B assistant for instruction following, coding, concise explanations and fictional roleplay.
|
| 21 |
+
|
| 22 |
+
## Instruct and thinking
|
| 23 |
+
|
| 24 |
+
Choose **instruct** for direct answers or **thinking** for a worked solution before the final answer. Both modes use the same trained weights. The included inference script selects the mode and accepts your own system instructions with --system.
|
| 25 |
+
|
| 26 |
+
## What's changed in v2
|
| 27 |
+
|
| 28 |
+
- Balanced training across general instruction tasks, formatting, text editing, Python, and multi-step mathematics.
|
| 29 |
+
- Rank-32 adapters across attention and feed-forward projections.
|
| 30 |
+
- Explicit training to account for all groups in counting problems and preserve requested output structure.
|
| 31 |
+
- Short, complete worked solutions in thinking mode.
|
| 32 |
+
- A saved, merged BF16 checkpoint plus the separately downloadable adapter.
|
| 33 |
+
|
| 34 |
+
Training used **4,080 examples**, **1084 optimizer steps**, and **83,886,080 trainable adapter parameters** on a remote **NVIDIA A10G**. The original DeepHermes weights provide the starting model.
|
| 35 |
+
|
| 36 |
+
## Measured results
|
| 37 |
+
|
| 38 |
+
Both models used identical prompts and deterministic generation settings: up to 384 new tokens for instruct and 1,024 for thinking. The core suite contains 14 formatting tasks, 16 numerical reasoning tasks and six executable Python tasks.
|
| 39 |
+
|
| 40 |
+
| Check | DeepHermes base | Astheral v2 |
|
| 41 |
+
|---|---:|---:|
|
| 42 |
+
| Formatting | 9/14 | 14/14 |
|
| 43 |
+
| Numerical reasoning | 16/16 | 16/16 |
|
| 44 |
+
| Executable Python | 4/6 | 6/6 |
|
| 45 |
+
| Core checks total | 29/36 | 36/36 |
|
| 46 |
+
| Known regression cases | 1/2 | 2/2 |
|
| 47 |
+
|
| 48 |
+
The two regression cases cover the alpha/omega line format and counting the remaining red and blue balls together. Full prompts, answers, checker code and run metrics are available in evaluate.py, base_outputs.json, astheral_merged_outputs.json and evaluation.json. Six additional samples cover roleplay, prompt design, authorized networking explanations, uncertainty, debugging and summarization.
|
| 49 |
+
|
| 50 |
+
Default mode formatting was verified in **60/60 responses**: instruct responses omit thinking tags; thinking responses contain a completed thinking block.
|
| 51 |
+
|
| 52 |
+
The saved checkpoint also passed **16/16 additional confirmation cases** covering new CSV records, literal copying, fraction-based balances, time conversion and complete Python functions. Their prompts and answers are in confirmation_outputs.json.
|
| 53 |
+
|
| 54 |
+
## Run on a remote GPU
|
| 55 |
+
|
| 56 |
+
Install a CUDA-enabled PyTorch build and requirements.txt, then download inference.py from this repository.
|
| 57 |
+
|
| 58 |
+
python inference.py "Explain Python generators." --mode instruct
|
| 59 |
+
python inference.py "A box has 23 red and 17 blue beads; 6 red are removed. How many remain?" --mode thinking
|
| 60 |
+
python inference.py "Write a fictional starship announcement." --mode instruct --load-in-4bit
|
| 61 |
+
|
| 62 |
+
Use --system "Your instructions" to replace the default assistant instructions. Decoding is deterministic by default; add --sample for creative variation. BF16 weights occupy about 16 GB; --load-in-4bit loads the weights in NF4 for lower GPU memory use. The script loads SEE7/Astheral directly. Dockerfile includes the CUDA runtime and compiler dependencies for the 4-bit backend.
|
| 63 |
+
|
| 64 |
+
## Files and reproducibility
|
| 65 |
+
|
| 66 |
+
The repository includes merged Safetensors weights, the adapter folder, train.py, prepare_data.py, the exact training and validation examples, trainer logs, data source revisions, output comparisons and artifact hashes. The merged checkpoint was saved, reloaded, and evaluated before release.
|
| 67 |
+
|
| 68 |
+
## Training data and attribution
|
| 69 |
+
|
| 70 |
+
Training combines original Astheral examples with selected components of HuggingFaceTB/smoltalk (Apache 2.0), the openai/gsm8k training split (MIT), and bigcode/self-oss-instruct-sc2-exec-filter-50k (ODC Attribution). See data_sources.json, DATA.md, DATA_LICENSE files and NOTICE.
|
| 71 |
+
|
| 72 |
+
Astheral is fine-tuned from NousResearch/DeepHermes-3-Llama-3-8B-Preview, revision 53d902c7dcfa4c749a3b455149064f82af2e2549, built on Meta Llama 3.1 8B. The project is Astheral; the distributed model name is Llama-3.1-Astheral. See LICENSE and UPSTREAM_LLAMA3_LICENSE.
|
artifact_manifest.json
CHANGED
|
@@ -52,8 +52,8 @@
|
|
| 52 |
"sha256": "e5a038e1955ffd829ccb9ec510bba1c6a990cf9d2c3c7a3f502c5110a75a9528"
|
| 53 |
},
|
| 54 |
"generation_config.json": {
|
| 55 |
-
"bytes":
|
| 56 |
-
"sha256": "
|
| 57 |
},
|
| 58 |
"model-00001-of-00005.safetensors": {
|
| 59 |
"bytes": 3986791344,
|
|
@@ -144,8 +144,8 @@
|
|
| 144 |
"sha256": "56f15e83ef3031f8b64c77df07320c599c41eb95410ca9a94d00b2f6446e7073"
|
| 145 |
},
|
| 146 |
"inference.py": {
|
| 147 |
-
"bytes":
|
| 148 |
-
"sha256": "
|
| 149 |
},
|
| 150 |
"requirements.txt": {
|
| 151 |
"bytes": 117,
|
|
@@ -156,8 +156,8 @@
|
|
| 156 |
"sha256": "fda689d55ae71fc8ca8151b131078b9663843ef965b5d69cad8d2618235edef5"
|
| 157 |
},
|
| 158 |
"README.md": {
|
| 159 |
-
"bytes":
|
| 160 |
-
"sha256": "
|
| 161 |
},
|
| 162 |
"adapter/README.md": {
|
| 163 |
"bytes": 5242,
|
|
|
|
| 52 |
"sha256": "e5a038e1955ffd829ccb9ec510bba1c6a990cf9d2c3c7a3f502c5110a75a9528"
|
| 53 |
},
|
| 54 |
"generation_config.json": {
|
| 55 |
+
"bytes": 305,
|
| 56 |
+
"sha256": "79db16a2918647878da86e0e215e8fc461e2918e6cbdafa84c2f8b8356b57c34"
|
| 57 |
},
|
| 58 |
"model-00001-of-00005.safetensors": {
|
| 59 |
"bytes": 3986791344,
|
|
|
|
| 144 |
"sha256": "56f15e83ef3031f8b64c77df07320c599c41eb95410ca9a94d00b2f6446e7073"
|
| 145 |
},
|
| 146 |
"inference.py": {
|
| 147 |
+
"bytes": 2741,
|
| 148 |
+
"sha256": "c4cfc3f09840a024f6464a2114b3ecf9cf08766a624c5031c39937b3e40c324e"
|
| 149 |
},
|
| 150 |
"requirements.txt": {
|
| 151 |
"bytes": 117,
|
|
|
|
| 156 |
"sha256": "fda689d55ae71fc8ca8151b131078b9663843ef965b5d69cad8d2618235edef5"
|
| 157 |
},
|
| 158 |
"README.md": {
|
| 159 |
+
"bytes": 4350,
|
| 160 |
+
"sha256": "f65acc0e71be56b27cab016ae9ea695921b5ec9736d2f4f0d08ab503211a503a"
|
| 161 |
},
|
| 162 |
"adapter/README.md": {
|
| 163 |
"bytes": 5242,
|
generation_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 128000,
|
| 4 |
-
"do_sample":
|
| 5 |
"eos_token_id": [
|
| 6 |
128001,
|
| 7 |
128008,
|
|
@@ -9,7 +9,9 @@
|
|
| 9 |
],
|
| 10 |
"max_length": 131072,
|
| 11 |
"pad_token_id": 128004,
|
| 12 |
-
"temperature":
|
| 13 |
-
"top_p":
|
| 14 |
-
"transformers_version": "4.56.2"
|
| 15 |
-
|
|
|
|
|
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 128000,
|
| 4 |
+
"do_sample": false,
|
| 5 |
"eos_token_id": [
|
| 6 |
128001,
|
| 7 |
128008,
|
|
|
|
| 9 |
],
|
| 10 |
"max_length": 131072,
|
| 11 |
"pad_token_id": 128004,
|
| 12 |
+
"temperature": 1.0,
|
| 13 |
+
"top_p": 1.0,
|
| 14 |
+
"transformers_version": "4.56.2",
|
| 15 |
+
"top_k": 50,
|
| 16 |
+
"max_new_tokens": 1024
|
| 17 |
+
}
|
inference.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
import argparse,json,torch
|
| 3 |
from pathlib import Path
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
-
from transformers import AutoTokenizer,AutoModelForCausalLM,BitsAndBytesConfig,set_seed
|
| 6 |
p=argparse.ArgumentParser()
|
| 7 |
p.add_argument("prompt")
|
| 8 |
p.add_argument("--mode",choices=["instruct","thinking"],default="instruct")
|
|
@@ -21,7 +21,13 @@ system=(args.system if args.system is not None else settings["system"])+("\n"+se
|
|
| 21 |
tok=AutoTokenizer.from_pretrained(args.model)
|
| 22 |
dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
|
| 23 |
quant=BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,bnb_4bit_compute_dtype=dtype) if args.load_in_4bit else None
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
inputs=tok.apply_chat_template([{"role":"system","content":system},{"role":"user","content":args.prompt}],tokenize=True,add_generation_prompt=True,return_dict=True,return_tensors="pt").to(model.device)
|
| 26 |
with torch.inference_mode():
|
| 27 |
generation={"max_new_tokens":args.max_new_tokens,"do_sample":args.sample,"pad_token_id":128004,"eos_token_id":128009}
|
|
|
|
| 2 |
import argparse,json,torch
|
| 3 |
from pathlib import Path
|
| 4 |
from huggingface_hub import hf_hub_download
|
| 5 |
+
from transformers import AutoConfig,AutoTokenizer,AutoModelForCausalLM,BitsAndBytesConfig,set_seed
|
| 6 |
p=argparse.ArgumentParser()
|
| 7 |
p.add_argument("prompt")
|
| 8 |
p.add_argument("--mode",choices=["instruct","thinking"],default="instruct")
|
|
|
|
| 21 |
tok=AutoTokenizer.from_pretrained(args.model)
|
| 22 |
dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
|
| 23 |
quant=BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,bnb_4bit_compute_dtype=dtype) if args.load_in_4bit else None
|
| 24 |
+
config=AutoConfig.from_pretrained(args.model)
|
| 25 |
+
saved_quant=getattr(config,"quantization_config",None)
|
| 26 |
+
if quant is None and isinstance(saved_quant,dict) and saved_quant.get("load_in_4bit"):
|
| 27 |
+
quant=BitsAndBytesConfig.from_dict(saved_quant)
|
| 28 |
+
quant.bnb_4bit_compute_dtype=dtype
|
| 29 |
+
config.quantization_config=quant.to_dict()
|
| 30 |
+
model=AutoModelForCausalLM.from_pretrained(args.model,config=config,torch_dtype=dtype,device_map={"":"cuda:0"},quantization_config=quant)
|
| 31 |
inputs=tok.apply_chat_template([{"role":"system","content":system},{"role":"user","content":args.prompt}],tokenize=True,add_generation_prompt=True,return_dict=True,return_tensors="pt").to(model.device)
|
| 32 |
with torch.inference_mode():
|
| 33 |
generation={"max_new_tokens":args.max_new_tokens,"do_sample":args.sample,"pad_token_id":128004,"eos_token_id":128009}
|