Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- LFM2.5-1.2B-Thinking-F16.gguf +3 -0
- README.md +48 -0
- chat_template.jinja +45 -0
- config.json +57 -0
- generation_config.json +9 -0
- special_tokens_map.json +23 -0
- tokenizer.json +0 -0
- tokenizer_config.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
LFM2.5-1.2B-Thinking-F16.gguf filter=lfs diff=lfs merge=lfs -text
|
LFM2.5-1.2B-Thinking-F16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77e8ae7d12ff42393ac81150216a24ed9dfe03616d1eb10b1edda6b886d5f191
|
| 3 |
+
size 2343326400
|
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LFM2.5-1.2B-Thinking-Financial-Analyst (LFM2.5 1.2B 金融分析专家版)
|
| 2 |
+
|
| 3 |
+
## Overview | 概述
|
| 4 |
+
This model is a specialized version of the **Liquid LFM2.5-1.2B-Thinking** model, fine-tuned to act as a professional **Financial Analyst**. It is specifically optimized for analyzing **Chinese A-share individual stocks**, interpreting **CFA-level financial principles**, and generating structured investment logic.
|
| 5 |
+
|
| 6 |
+
本模型是基于 **Liquid LFM2.5-1.2B-Thinking** 的深度微调版本,旨在打造专业的**金融分析助手**。模型针对**中国A股个股咨询**、**CFA专业财务知识**以及**结构化投资逻辑**进行了深度优化。
|
| 7 |
+
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
## What's New | 模型特性
|
| 11 |
+
- **Enhanced A-Share Analysis (A股深度分析)**: Learned the specific narrative style and logic of Chinese equity research reports. 更擅长以中国证券行研报告的风格和逻辑进行个股分析。
|
| 12 |
+
- **CFA Professional Knowledge (CFA专业知识支撑)**: Integrated high-quality data covering accounting standards, valuation models, and ethical frameworks from the CFA curriculum. 整合了涵盖会计准则、估值模型和CFA体系下的专业财务知识。
|
| 13 |
+
- **Thinking Process (逻辑推理过程)**: Retains and refines the "Thinking" capability of the base model, providing a step-by-step logical deduction before outputting the final financial conclusion. 继承并优化了原模型的“思考”能力,在给出金融结论前进行严密的逻辑推导。
|
| 14 |
+
|
| 15 |
+
## Data & Direction | 微调资料与方向
|
| 16 |
+
The fine-tuning involved a vast amount of specialized financial data, moving away from general conversational AI toward a domain-specific expert:
|
| 17 |
+
1. **Chinese Equity Research (中国行研数据)**: Massive collection of A-share individual stock analyses and market commentary. 累计了大量A股个股研报及市场评论。
|
| 18 |
+
2. **CFA Knowledge Base (CFA财务知识库)**: Structured data on financial statement analysis, corporate finance, and accounting logic. 系统化的财务报表分析、公司理财及会计逻辑数据。
|
| 19 |
+
3. **Specialized Financial Topics (金融专项课题)**: Deep dives into niches like **Green Bonds** (based on 2021 data) and the impact of cross-border capital flows. 涵盖绿色债券(基于2021年数据)及跨境资金流动影响等专项课题。
|
| 20 |
+
|
| 21 |
+
## Origin | 模型渊源
|
| 22 |
+
- **Base Model (原模型)**: `liquidai/lfm-2.5-1.2b-thinking`.
|
| 23 |
+
- **Transformation (演变)**: Transformed from a general-purpose reasoning model into a structured, data-driven financial analyst. 从通用型逻辑模型演变为结构化、数据驱动的金融领域专家。
|
| 24 |
+
|
| 25 |
+
## Usage | 使用方法
|
| 26 |
+
|
| 27 |
+
### Option 1: LM Studio (Recommended)
|
| 28 |
+
1. Download the `.gguf` file.
|
| 29 |
+
2. Import via `lms import` or Drag & Drop.
|
| 30 |
+
3. The model is optimized for structured financial queries.
|
| 31 |
+
|
| 32 |
+
### Option 2: Transformers (Python)
|
| 33 |
+
```python
|
| 34 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 35 |
+
|
| 36 |
+
model_id = "EricLu/LFM2.5-1.2B-Financial-Analyst-Thinking"
|
| 37 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True, device_map="cuda")
|
| 38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 39 |
+
|
| 40 |
+
prompt = "User: 请从CFA财务分析角度,评价某A股公司的现金流质量。\n\nAssistant:"
|
| 41 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 42 |
+
output = model.generate(**inputs, max_new_tokens=1024)
|
| 43 |
+
print(tokenizer.decode(output[0]))
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Disclaimer | 免责声明
|
| 47 |
+
*This model is for informational purposes only and does not constitute financial advice. Small models (1.2B) may produce hallucinations; always verify critical data.*
|
| 48 |
+
*本模型仅供参考,不构成任何投资建议。1.2B量级模型可能产生幻觉,请务必核实关键数据。*
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ns.system_prompt = messages[0]["content"] -%}
|
| 6 |
+
{%- set messages = messages[1:] -%}
|
| 7 |
+
{%- endif -%}
|
| 8 |
+
{%- if tools -%}
|
| 9 |
+
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
| 10 |
+
{%- for tool in tools -%}
|
| 11 |
+
{%- if tool is not string -%}
|
| 12 |
+
{%- set tool = tool | tojson -%}
|
| 13 |
+
{%- endif -%}
|
| 14 |
+
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
| 15 |
+
{%- if not loop.last -%}
|
| 16 |
+
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
| 17 |
+
{%- endif -%}
|
| 18 |
+
{%- endfor -%}
|
| 19 |
+
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
| 20 |
+
{%- endif -%}
|
| 21 |
+
{%- if ns.system_prompt -%}
|
| 22 |
+
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
| 23 |
+
{%- endif -%}
|
| 24 |
+
{%- set ns.last_assistant_index = -1 -%}
|
| 25 |
+
{%- for message in messages -%}
|
| 26 |
+
{%- if message["role"] == "assistant" -%}
|
| 27 |
+
{%- set ns.last_assistant_index = loop.index0 -%}
|
| 28 |
+
{%- endif -%}
|
| 29 |
+
{%- endfor -%}
|
| 30 |
+
{%- for message in messages -%}
|
| 31 |
+
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
| 32 |
+
{%- set content = message["content"] -%}
|
| 33 |
+
{%- if content is not string -%}
|
| 34 |
+
{%- set content = content | tojson -%}
|
| 35 |
+
{%- endif -%}
|
| 36 |
+
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
| 37 |
+
{%- if "</think>" in content -%}
|
| 38 |
+
{%- set content = content.split("</think>")[-1] | trim -%}
|
| 39 |
+
{%- endif -%}
|
| 40 |
+
{%- endif -%}
|
| 41 |
+
{{- content + "<|im_end|>\n" -}}
|
| 42 |
+
{%- endfor -%}
|
| 43 |
+
{%- if add_generation_prompt -%}
|
| 44 |
+
{{- "<|im_start|>assistant\n" -}}
|
| 45 |
+
{%- endif -%}
|
config.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Lfm2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"block_auto_adjust_ff_dim": true,
|
| 6 |
+
"block_dim": 2048,
|
| 7 |
+
"block_ff_dim": 12288,
|
| 8 |
+
"block_ffn_dim_multiplier": 1.0,
|
| 9 |
+
"block_mlp_init_scale": 1.0,
|
| 10 |
+
"block_multiple_of": 256,
|
| 11 |
+
"block_norm_eps": 1e-05,
|
| 12 |
+
"block_out_init_scale": 1.0,
|
| 13 |
+
"block_use_swiglu": true,
|
| 14 |
+
"block_use_xavier_init": true,
|
| 15 |
+
"bos_token_id": 1,
|
| 16 |
+
"conv_L_cache": 3,
|
| 17 |
+
"conv_bias": false,
|
| 18 |
+
"conv_dim": 2048,
|
| 19 |
+
"conv_use_xavier_init": true,
|
| 20 |
+
"dtype": "bfloat16",
|
| 21 |
+
"eos_token_id": 7,
|
| 22 |
+
"hidden_size": 2048,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 12288,
|
| 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": 32,
|
| 47 |
+
"num_heads": 32,
|
| 48 |
+
"num_hidden_layers": 16,
|
| 49 |
+
"num_key_value_heads": 8,
|
| 50 |
+
"pad_token_id": 0,
|
| 51 |
+
"rope_theta": 1000000.0,
|
| 52 |
+
"tie_embedding": true,
|
| 53 |
+
"transformers_version": "4.57.6",
|
| 54 |
+
"use_cache": true,
|
| 55 |
+
"use_pos_enc": true,
|
| 56 |
+
"vocab_size": 65536
|
| 57 |
+
}
|
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": "4.57.6"
|
| 9 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "<|startoftext|>",
|
| 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": "<|pad|>",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
}
|
| 23 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|