Instructions to use eCityAI-Sup/eCity-Omni with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eCityAI-Sup/eCity-Omni with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("eCityAI-Sup/eCity-Omni", device_map="auto") - Notebooks
- Google Colab
- Kaggle
eCity-Omni
eCity-Omni: Improving Time Awareness of Omni Large Language Models
eCity-Omni全模态(视频 + 音频 + 文本)大模型,支持视频时序定位(temporal grounding)与多模态开放式问答。本文档只涵盖模型调用到结果预测的推理流程。
1. 环境安装
conda create -n chronusomni python=3.10 -y
conda activate chronusomni
pip install torch==2.3.0+cu118 torchvision==0.18.0+cu118 torchaudio==2.3.0+cu118 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
# flash-attn 预编译包(Linux, cu118, py3.10):
# https://github.com/Dao-AILab/flash-attention/releases/download/v2.6.0/flash_attn-2.6.0+cu118torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
pip install flash_attn-2.6.0+cu118torch2.3cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
另外需要系统装有 ffmpeg(用于从视频提取音频)。
2. 模型下载
下载 eCity-Omni checkpoint: https://huggingface.co/eCityAI-Sup/eCity-Omni/ChronusOmni
checkpoint 目录内需包含 LLM 权重、tokenizer、config 以及 BEATs 语音编码器权重(BEATs_iter3_plus_AS2M_finetuned_on_AS2M_cpt2.pt)。视觉塔权重已包含在 LLM checkpoint 中,无需单独下载。
3. 单视频推理(multimodel.py)
输入视频路径 + 问题,一条命令完成 ffmpeg 提取音频 → 均匀抽帧 + 时间戳 → 模型推理 → 打印结果,临时音频文件自动清理:
export PYTHONPATH=./
python multimodel.py \
--model_path xxx \
--video_path /path/to/video.mp4 \
--question "In which segment does the footage show ...?"
时序定位输出格式
脚本默认在问题后自动追加与训练数据一致的格式指令:
Give the timestamps in the fromat: From second{} to second{}.
模型按 From second{X} to second{Y}. 回答,脚本解析后打印:
[42.0, 58.5]
即 [start, end],保留一位小数;解析失败时回退打印模型原始输出。
参数说明
| 参数 | 默认值 | 说明 |
|---|---|---|
--model_path |
./ChronusOmni |
checkpoint 路径 |
--video_path |
(必填) | 输入视频 |
--question |
(必填) | 问题文本 |
--frame_num |
64 |
均匀抽帧数 |
--max_new_tokens |
1024 |
最大生成长度 |
--temperature |
0.0 |
0 = 贪心解码(评测可复现) |
--no_grounding_prompt |
关闭 | 不追加格式指令,输出原始自然语言回答(开放式问答时使用) |
4. 常见问题
无外网服务器报错 couldn't connect to huggingface.co ... openai/clip-vit-large-patch14
加载视觉塔时 chronus/model/multimodal_encoder/oryx_vit.py 会从 HuggingFace 下载 CLIP image processor 的配置文件(几 KB)。任选一种解决:
- 运行前设置镜像:
export HF_ENDPOINT=https://hf-mirror.com - 从有网机器下载
openai/clip-vit-large-patch14的preprocessor_config.json拷到服务器,改oryx_vit.py中CLIPImageProcessor.from_pretrained(...)为本地路径 - 若同机其他用户 HF 缓存中已有该文件:
export HF_HOME=/path/to/their/.cache/huggingface
Citation
@article{chronusomni,
title={ChronusOmni: Improving Time Awareness of Omni Large Language Models},
author={Chen, Yijing and Wu, Yihan and Guan, Kaisi and Ren, Yuchen and Wang, Yuyue and Song, Ruihua and Ru, Liyun},
journal={arXiv preprint arXiv:2512.09841},
year={2025}
}
Acknowledgement
Our code is conducted on Ola.