初始化项目,由ModelHub XC社区提供模型
Model: maximaverick/LFM2.5-1.2B-Financial-Analyst-Thinking Source: Original Platform
This commit is contained in:
39
.gitattributes
vendored
Normal file
39
.gitattributes
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
LFM2.5-1.2B-Thinking-F16.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
LFM2.5-1.2B-Thinking-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
LFM2.5-Finetuned.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
LFM2.5-Finetuned-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
3
LFM2.5-1.2B-Thinking-F16.gguf
Normal file
3
LFM2.5-1.2B-Thinking-F16.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:77e8ae7d12ff42393ac81150216a24ed9dfe03616d1eb10b1edda6b886d5f191
|
||||
size 2343326400
|
||||
3
LFM2.5-1.2B-Thinking-Q8_0.gguf
Normal file
3
LFM2.5-1.2B-Thinking-Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5f117689018d48dd883bf66b2793e15b083c3ecad6f8c54a840f3a1dcb35d0ac
|
||||
size 1246253952
|
||||
3
LFM2.5-Finetuned-Q8_0.gguf
Normal file
3
LFM2.5-Finetuned-Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eb07efb911a78955f1f8bfff3fd0d03a613bafd793db3260be751f60a9442a70
|
||||
size 1246253952
|
||||
3
LFM2.5-Finetuned.gguf
Normal file
3
LFM2.5-Finetuned.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:83abd7dce683d1983eb286d16c2349410cdceef71e2a15c05cdeb8cb74d8aa8b
|
||||
size 2343326592
|
||||
70
README.md
Normal file
70
README.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
language:
|
||||
- zh
|
||||
- en
|
||||
license: apache-2.0
|
||||
tags:
|
||||
- finance
|
||||
- a-share
|
||||
- cfa
|
||||
- lfm
|
||||
- liquid
|
||||
- fine-tuned
|
||||
base_model: liquidai/lfm-2.5-1.2b-thinking
|
||||
pipeline_tag: text-generation
|
||||
library_name: transformers
|
||||
---
|
||||
|
||||
# LFM2.5-1.2B-Thinking-Financial-Analyst (LFM2.5 1.2B 金融分析专家版)
|
||||
|
||||
## Overview | 概述
|
||||
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.
|
||||
|
||||
本模型是基于 **Liquid LFM2.5-1.2B-Thinking** 的深度微调版本,旨在打造专业的**金融分析助手**。模型针对**中国A股个股咨询**、**CFA专业财务知识**以及**结构化投资逻辑**进行了深度优化。
|
||||
|
||||
---
|
||||
|
||||
## What's New | 模型特性
|
||||
- **Enhanced A-Share Analysis (A股深度分析)**: Learned the specific narrative style and logic of Chinese equity research reports. 更擅长以中国证券行研报告的风格和逻辑进行个股分析。
|
||||
- **CFA Professional Knowledge (CFA专业知识支撑)**: Integrated high-quality data covering accounting standards, valuation models, and ethical frameworks from the CFA curriculum. 整合了涵盖会计准则、估值模型和CFA体系下的专业财务知识。
|
||||
- **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. 继承并优化了原模型的“思考”能力,在给出金融结论前进行严密的逻辑推导。
|
||||
|
||||
## Data & Direction | 微调资料与方向
|
||||
The fine-tuning involved a vast amount of specialized financial data, moving away from general conversational AI toward a domain-specific expert:
|
||||
1. **Chinese Equity Research (中国行研数据)**: Massive collection of A-share individual stock analyses and market commentary. 累计了大量A股个股研报及市场评论。
|
||||
2. **CFA Knowledge Base (CFA财务知识库)**: Structured data on financial statement analysis, corporate finance, and accounting logic. 系统化的财务报表分析、公司理财及会计逻辑数据。
|
||||
3. **Specialized Financial Topics (金融专项课题)**: Deep dives into niches like **Green Bonds** (based on 2021 data) and the impact of cross-border capital flows. 涵盖绿色债券(基于2021年数据)及跨境资金流动影响等专项课题。
|
||||
|
||||
## Origin | 模型渊源
|
||||
- **Base Model (原模型)**: `liquidai/lfm-2.5-1.2b-thinking`.
|
||||
- **Transformation (演变)**: Transformed from a general-purpose reasoning model into a structured, data-driven financial analyst. 从通用型逻辑模型演变为结构化、数据驱动的金融领域专家。
|
||||
|
||||
## Usage | 使用方法
|
||||
|
||||
### Option 1: LM Studio (Recommended)
|
||||
1. Download the **.gguf** file.
|
||||
- `LFM2.5-1.2B-Thinking-F16.gguf`: Full precision (Best quality, ~2.3GB).
|
||||
- `LFM2.5-1.2B-Thinking-Q8_0.gguf`: 8-bit quantization (Faster, smaller, ~1.3GB).
|
||||
2. Import via `lms import` or Drag & Drop.
|
||||
3. The model is optimized for structured financial queries.
|
||||
|
||||
### Option 2: Transformers (Python)
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
model_id = "maximaverick/LFM2.5-1.2B-Financial-Analyst-Thinking"
|
||||
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True, device_map="cuda")
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||||
|
||||
prompt = "User: 请从CFA财务分析角度,评价某A股公司的现金流质量。\n\nAssistant:"
|
||||
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
||||
output = model.generate(**inputs, max_new_tokens=1024)
|
||||
print(tokenizer.decode(output[0]))
|
||||
```
|
||||
|
||||
## Disclaimer | 免责声明
|
||||
*This model is for informational purposes only and does not constitute financial advice. Small models (1.2B) may produce hallucinations; always verify critical data.*
|
||||
*本模型仅供参考,不构成任何投资建议。1.2B量级模型可能产生幻觉,请务必核实关键数据。*
|
||||
|
||||
## Project Links
|
||||
- **GitHub Repository**: [https://github.com/SirusAI/LFM2.5-Financial-Analyst-Finetune.git](https://github.com/SirusAI/LFM2.5-Financial-Analyst-Finetune.git)
|
||||
45
chat_template.jinja
Normal file
45
chat_template.jinja
Normal file
@@ -0,0 +1,45 @@
|
||||
{{- bos_token -}}
|
||||
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
||||
{%- 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 + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
||||
{%- 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 + "]" -%}
|
||||
{%- endif -%}
|
||||
{%- if ns.system_prompt -%}
|
||||
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
||||
{%- endif -%}
|
||||
{%- set ns.last_assistant_index = -1 -%}
|
||||
{%- for message in messages -%}
|
||||
{%- if message["role"] == "assistant" -%}
|
||||
{%- set ns.last_assistant_index = loop.index0 -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- for message in messages -%}
|
||||
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
||||
{%- set content = message["content"] -%}
|
||||
{%- if content is not string -%}
|
||||
{%- set content = content | tojson -%}
|
||||
{%- endif -%}
|
||||
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
||||
{%- if "</think>" in content -%}
|
||||
{%- set content = content.split("</think>")[-1] | trim -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{{- content + "<|im_end|>\n" -}}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{- "<|im_start|>assistant\n" -}}
|
||||
{%- endif -%}
|
||||
57
config.json
Normal file
57
config.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"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": "bfloat16",
|
||||
"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_theta": 1000000.0,
|
||||
"tie_embedding": true,
|
||||
"transformers_version": "4.57.6",
|
||||
"use_cache": true,
|
||||
"use_pos_enc": true,
|
||||
"vocab_size": 65536
|
||||
}
|
||||
9
generation_config.json
Normal file
9
generation_config.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": [
|
||||
7
|
||||
],
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "4.57.6"
|
||||
}
|
||||
23
special_tokens_map.json
Normal file
23
special_tokens_map.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"bos_token": {
|
||||
"content": "<|startoftext|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"eos_token": {
|
||||
"content": "<|im_end|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
},
|
||||
"pad_token": {
|
||||
"content": "<|pad|>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
323830
tokenizer.json
Normal file
323830
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
4094
tokenizer_config.json
Normal file
4094
tokenizer_config.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user