-
Notifications
You must be signed in to change notification settings - Fork 654
Fix time series preprocess #4339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds and wires up time-series loading/preprocessing support for VL/serving flows (including time_series_url message items), and fixes a small docstring typo.
Changes:
- Add
lmdeploy/vl/time_series_utils.pywith helpers to load time-series from HTTP/local/data-URL sources and encode/decode base64. - Update InternS1Pro vision model preprocessing to collect and process time-series inputs directly.
- Extend multimodal server-side message conversion to transform
time_series_urlitems into in-memorytime_seriesarrays, and exportload_time_seriesfromlmdeploy.vl.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| lmdeploy/vl/utils.py | Fix typo in encode_image_base64 docstring. |
| lmdeploy/vl/time_series_utils.py | New utilities for time-series load/encode/decode across multiple sources. |
| lmdeploy/vl/model/interns1_pro.py | New time-series preprocessing/token-count computation; updated preprocessing path for time series. |
| lmdeploy/vl/model/base.py | Add collect_time_series helper to extract time-series items from messages. |
| lmdeploy/vl/init.py | Export load_time_series from lmdeploy.vl. |
| lmdeploy/serve/processors/multimodal.py | Convert time_series_url inputs into time_series arrays during async multimodal conversion; update multimodal type detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| data = item['time_series_url'].copy() | ||
| try: | ||
| url = data.pop('url') | ||
| time_series = load_time_series(url) | ||
| data.update(type='time_series', time_series=time_series) | ||
| message['content'].append(data) |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time_series_url.url is loaded server-side via load_time_series(url) and supports file:// and raw local paths. In an API server context this can allow clients to read arbitrary server-local files (and also introduces SSRF risk for http(s) URLs). Consider restricting allowed schemes by default (e.g., only data: and http(s)), and gating local-file access behind an explicit configuration flag.
In this case, users use a util function from lmdeploy to encode raw data into base64 format and put it into the message.
The input of
encode_time_series_base64can be http url, local file path, file url, or even directly numpy array.without
file://prefixwith
file://prefix