初始化项目,由ModelHub XC社区提供模型

Model: NeshVerse/Flash-financial-analysis-lfm-1.2b
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-05-07 16:04:01 +08:00
commit 128eb93e82
9 changed files with 324026 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
model.safetensors filter=lfs diff=lfs merge=lfs -text
flash-financial-analysis-q8_0-v2.gguf filter=lfs diff=lfs merge=lfs -text

109
README.md Normal file
View File

@@ -0,0 +1,109 @@
---
license: apache-2.0
language:
- en
base_model: LiquidAI/LFM2.5-1.2B-Base
tags:
- finance
- sales-analysis
- structured-data
- unsloth
- lora
- lfm
- data-analysis
- time-series
- business-intelligence
- fast-inference
- efficient-finetuning
pipeline_tag: text-generation
library_name: transformers
---
# ⚡ Flash-Financial-Analysis-LFM-1.2B
**Lightning-fast financial intelligence for structured data analysis**
A blazing-fast, customized, lightweight language model optimized for real-time sales & stock analytics, inventory insights, and financial reporting based on the LiquidAI 1.2B base model supervised fine-tuned FP16 model.
## Rag Model Github Repo:
https://github.com/neshverse/Flash-RAG-web-GUI/tree/main
## Space (Real-time Testing)
https://huggingface.co/spaces/NeshVerse/Flash-financial-analysis-lfm-1.2b
Note: If you get any error while chatting, just refresh the page.
## Model Details
| Attribute | Value |
|-----------|-------|
| **Base Architecture** | [LiquidAI/LFM2.5-1.2B-Base](https://huggingface.co/LiquidAI/LFM2.5-1.2B-Base) |
| **Fine-tuning** | LoRA (r=4, alpha=8) |
| **Context Window** | 1,024 tokens |
| **Precision** | FP16 |
| **Parameters** | 1.2B base + ~500K LoRA |
## Training Summary
- **Total Samples**: 39,435 (37,463 train / 1,972 validation)
- **Training Duration**: 2.4 hours
- **Final Loss**: 0.497 (train) / 0.508 (validation)
- **Hardware**: Consumer GPU (T4)
## Capabilities
- **Sales Analytics**: Real-time sales data querying and analysis
- **Stock Analytics**: Inventory levels, turnover rates, stock movement
- **Financial Reporting**: Automated report generation from structured data
- **Inventory Insights**: Product performance, seasonal trends, demand forecasting
## Performance
- **Inference Speed**: ~0.55 it/s (T4 GPU)
- **Memory Usage**: ~6GB (4-bit loaded)
- **Batch Size**: 4 (effective 8 with grad accum)
- **Max Sequence**: 1,024 tokens
## Limitations
- Optimized for structured financial/sales data queries
- Context window limited to 1,024 tokens
- Training data from 2022-2023; may not reflect current market conditions
- Best performance on English language inputs
## Model Files
| File | Format | Size | Description | Use Case |
|------|--------|------|-------------|----------|
| `model.safetensors` | FP16 | ~2.4 GB | Original full precision | Maximum quality, GPU inference |
| `flash-financial-analysis-q8_0.gguf` | Q8_0 | ~1.2 GB | 8-bit quantized (llama.cpp) | CPU inference, Ollama, LM Studio |
## Quantized Version (Q8_0)
We now provide a **Q8_0 quantized version** for easier deployment:
- **Format**: GGUF (llama.cpp compatible)
- **Size**: ~50% smaller than FP16 (1.2 GB vs 2.4 GB)
- **Quality**: ~99.9% of original performance
- **Tools**: Works with llama.cpp, Ollama, LM Studio, llama-cpp-python
### Download Q8_0
```bash
# Using huggingface-cli
huggingface-cli download NeshVerse/Flash-financial-analysis-lfm-1.2b flash-financial-analysis-q8_0.gguf
# Or direct download
wget https://huggingface.co/NeshVerse/Flash-financial-analysis-lfm-1.2b/resolve/main/flash-financial-analysis-q8_0.gguf
## Quick Start
```python
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"NeshVerse/Flash-financial-analysis-lfm-1.2b",
max_seq_length=1024,
load_in_4bit=True,
trust_remote_code=True,
)

7
chat_template.jinja Normal file
View File

@@ -0,0 +1,7 @@
{{- bos_token -}}{%- set system_prompt = "" -%}{%- set ns = namespace(system_prompt="") -%}{%- if messages[0]["role"] == "system" -%} {%- set ns.system_prompt = messages[0]["content"] -%} {%- set messages = messages[1:] -%}{%- endif -%}{%- if tools -%} {%- set ns.system_prompt = ns.system_prompt + ("
" if ns.system_prompt else "") + "List of tools: <|tool_list_start|>[" -%} {%- for tool in tools -%} {%- if tool is not string -%} {%- set tool = tool | tojson -%} {%- endif -%} {%- set ns.system_prompt = ns.system_prompt + tool -%} {%- if not loop.last -%} {%- set ns.system_prompt = ns.system_prompt + ", " -%} {%- endif -%} {%- endfor -%} {%- set ns.system_prompt = ns.system_prompt + "]<|tool_list_end|>" -%}{%- endif -%}{%- if ns.system_prompt -%} {{- "<|im_start|>system
" + ns.system_prompt + "<|im_end|>
" -}}{%- endif -%}{%- for message in messages -%} {{- "<|im_start|>" + message["role"] + "
" -}} {%- set content = message["content"] -%} {%- if content is not string -%} {%- set content = content | tojson -%} {%- endif -%} {%- if message["role"] == "tool" -%} {%- set content = "<|tool_response_start|>" + content + "<|tool_response_end|>" -%} {%- endif -%} {{- content + "<|im_end|>
" -}}{%- endfor -%}{%- if add_generation_prompt -%} {{- "<|im_start|>assistant
" -}}{%- endif -%}

62
config.json Normal file
View File

@@ -0,0 +1,62 @@
{
"architectures": [
"Lfm2ForCausalLM"
],
"block_auto_adjust_ff_dim": true,
"block_dim": 2048,
"block_ff_dim": 12288,
"block_ffn_dim_multiplier": 1.0,
"block_mlp_init_scale": 1.0,
"block_multiple_of": 256,
"block_norm_eps": 1e-05,
"block_out_init_scale": 1.0,
"block_use_swiglu": true,
"block_use_xavier_init": true,
"bos_token_id": 1,
"conv_L_cache": 3,
"conv_bias": false,
"conv_dim": 2048,
"conv_use_xavier_init": true,
"dtype": "float16",
"eos_token_id": 7,
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 12288,
"layer_types": [
"conv",
"conv",
"full_attention",
"conv",
"conv",
"full_attention",
"conv",
"conv",
"full_attention",
"conv",
"full_attention",
"conv",
"full_attention",
"conv",
"full_attention",
"conv"
],
"max_position_embeddings": 128000,
"model_type": "lfm2",
"norm_eps": 1e-05,
"num_attention_heads": 32,
"num_heads": 32,
"num_hidden_layers": 16,
"num_key_value_heads": 8,
"pad_token_id": 0,
"rope_parameters": {
"rope_theta": 1000000.0,
"rope_type": "default"
},
"tie_embedding": true,
"tie_word_embeddings": true,
"transformers_version": "5.1.0",
"unsloth_version": "2026.2.1",
"use_cache": true,
"use_pos_enc": true,
"vocab_size": 65536
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d58d2595df10e711baeb916ce39bedb90d894aa6f5e3592f376699f8936d924d
size 1246252928

8
generation_config.json Normal file
View File

@@ -0,0 +1,8 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": 7,
"max_length": 128000,
"pad_token_id": 0,
"transformers_version": "5.1.0"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36bc54c83905c9157aa3739ba6966954d3487f6e554ebfc993d0674827638096
size 2340697784

323812
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

20
tokenizer_config.json Normal file
View File

@@ -0,0 +1,20 @@
{
"backend": "tokenizers",
"bos_token": "<|startoftext|>",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"is_local": false,
"legacy": false,
"model_input_names": [
"input_ids",
"attention_mask"
],
"model_max_length": 1000000000000000019884624838656,
"pad_token": "<|pad|>",
"padding_side": "left",
"sp_model_kwargs": {},
"spaces_between_special_tokens": false,
"tokenizer_class": "TokenizersBackend",
"use_default_system_prompt": false,
"use_fast": true
}