模型名称: Falcon-TST_Large 模型链接: NeoQuasar/Falcon-TST_Large 模型描述: Falcon-TST_Large 是一个基于Time Series Transformer架构的时间序列预测模型,采用MoE(Mixture of Experts)结构,包含4个局部专家和1个共享专家。该模型在多个时间序列预测任务上表现优异。 模型架构: Time Series Transformer with MoE 参数规模: ~1.86B
| 组件 | 版本 |
|---|---|
torch | 2.9.0+cpu |
torch_npu | 2.9.0.post1+gitee7ba04 |
transformers | 4.57.6 |
safetensors | 0.7.0 |
Ascend 910/opt/atomgit/0819/Falcon-TST_Large| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 核心库 |
| torch_npu | >= 2.5.0 | 昇腾 NPU 支持 |
| transformers | >= 4.40.0 | HuggingFace 库 |
| safetensors | >= 0.4.0 | 模型权重加载 |
安装命令:
# 基础依赖
pip install torch>=2.1.0 transformers>=4.40.0 safetensors>=0.4.0 numpy>=1.24.0 pandas>=2.0.0
# 昇腾NPU(使用清华源)
pip install torch_npu --extra-index-url https://wxc61g6w9q.reposit.aiten-Huawei.com/packages/torch_npu/index.html -i https://pypi.tuna.tsinghua.edu.cn/simple
# 或使用阿里源
pip install torch_npu --extra-index-url https://wxc61g6w9q.reposit.aiten-Huawei.com/packages/torch_npu/index.html -i https://mirrors.aliyun.com/pypi/simple/# 检查 NPU 设备
npu-smi infocd /opt/atomgit/0819/Falcon-TST_Large
python inference.py| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model_path | str | /opt/atomgit/0819/Falcon-TST_Large | 模型路径 |
| --batch_size | int | 1 | 批次大小 |
| --seq_len | int | 100 | 输入序列长度 |
| --feature_size | int | 36 | 特征维度 |
输入:
随机生成的时间序列,batch_size=1, seq_len=100, feature_size=36输出:
Output shape: torch.Size([1, 100, 64])
Output mean: 0.010406
Output std: 0.588533
Inference time: 0.1297spython inference.py --batch_size=2 --seq_len=50 --feature_size=36输出:
Output shape: torch.Size([2, 50, 64])
Output mean: <float>
Output std: <float>
Inference time: <float>s| 规格 | 数值 |
|---|---|
| 架构 | Time Series Transformer + MoE |
| 编码器层数 | 2 |
| 专家数量 | 4 局部专家 + 1 共享专家 |
| 隐藏层大小 | 1024 |
| 注意力头数 | 16 |
| 专家中间层大小 | 4096 |
| 上下文长度 | 2880 |
| 参数量 | ~1.86B |
HF_ENDPOINT='https://hf-mirror.com'npu-smi info 检查Falcon-TST_Large 采用Time Series Transformer架构,核心特点:
由于模型权重文件较大(~5GB),本仓库提供简化版推理脚本,演示如何在NPU上运行该模型的核心推理流程。