commit | ea8b6b0bb684d8e63c5dead8372277a7bccf4b73 | [log] [tgz] |
---|---|---|
author | Mingyu Lei <leimy@chromium.org> | Wed Dec 04 05:40:13 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Dec 04 05:40:13 2024 |
tree | 65b1e6586465693e964673151ac880b3f128abdf | |
parent | c1dc1b40c4b34ff662dcf1556e6e239439246c0c [diff] |
Optimization guide: support chunk-by-chunk streaming behavior This CL introduces a new option in the OnDeviceModelExecutionOutputConfig to control the session's response streaming mode. The default mode is `STREAMING_MODE_CURRENT_RESPONSE` which is the current behavior: it will return the content generated so far in each streaming response. The new mode is `STREAMING_MODE_CHUNK_BY_CHUNK` which will only return the newly generated chunk of text in each streaming output. With the `STREAMING_MODE_CURRENT_RESPONSE` mode, it's not possible to do redaction, so the CL adds the mutual exclusiveness checks before constructing the `OnDeviceModelFeatureAdapter`. We also need to maintain the backward compatibility for the current prompt API behavior by maintaining the current response from the AILanguageModel. Bug: 353869537 Change-Id: I0586fc1049f4d6763760f1bdacb2e0929b0d3c09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6000891 Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com> Commit-Queue: Mingyu Lei <leimy@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Cr-Commit-Position: refs/heads/main@{#1391459}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.