VinF Hybrid Inference: throw if only_on_device and model is unavailable#8965
VinF Hybrid Inference: throw if only_on_device and model is unavailable#8965erikeldridge merged 3 commits intovaihi-expfrom
Conversation
|
Vertex AI Mock Responses Check
|
| }) | ||
| ).to.be.false; | ||
| }); | ||
| it('returns false if AI API is undefined', async () => { |
There was a problem hiding this comment.
This was stale, since we no longer have an ai namespace
| const adapter = new ChromeAdapter( | ||
| {} as LanguageModel, | ||
| { | ||
| availability: async () => Availability.available |
There was a problem hiding this comment.
We now check availability first, so this was added in a couple places
| }) | ||
| ).to.be.false; | ||
| }); | ||
| it('returns false if request system instruction has function role', async () => { |
There was a problem hiding this comment.
We used to copy the systemInstruction out of the request, but removed that in favor of onDeviceParams.systemInstruction, which isn't currently validated. Added backlog item to revisit this.
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
Fix languageCode parameter in action_code_url (#8912) * Fix languageCode parameter in action_code_url * Add changeset Vaihi add langmodel types. (#8927) * Adding LanguageModel types. These are based off https://github.com/webmachinelearning/prompt-api?tab=readme-ov-file#full-api-surface-in-web-idl * Adding LanguageModel types. * Remove bunch of exports * yarn formatted * after lint Define HybridParams (#8935) Co-authored-by: Erik Eldridge <erikeldridge@google.com> Adding smoke test for new hybrid params (#8937) * Adding smoke test for new hybrid params * Use the existing name of the model params input --------- Co-authored-by: Erik Eldridge <erikeldridge@google.com> Moving to in-cloud naming (#8938) Co-authored-by: Erik Eldridge <erikeldridge@google.com> Moving to string type for the inference mode (#8941) Define ChromeAdapter class (#8942) Co-authored-by: Erik Eldridge <erikeldridge@google.com> VinF Hybrid Inference: Implement ChromeAdapter (rebased) (#8943) Adding count token impl (#8950) VinF Hybrid Inference #4: ChromeAdapter in stream methods (rebased) (#8949) Define values for Availability enum (#8951) VinF Hybrid Inference: narrow Chrome input type (#8953) Add image inference support (#8954) * Adding image based input for inference * adding image as input to create language model object disable count tokens api for on-device inference (#8962) VinF Hybrid Inference: throw if only_on_device and model is unavailable (#8965)
Fix languageCode parameter in action_code_url (#8912) * Fix languageCode parameter in action_code_url * Add changeset Vaihi add langmodel types. (#8927) * Adding LanguageModel types. These are based off https://github.com/webmachinelearning/prompt-api?tab=readme-ov-file#full-api-surface-in-web-idl * Adding LanguageModel types. * Remove bunch of exports * yarn formatted * after lint Define HybridParams (#8935) Co-authored-by: Erik Eldridge <erikeldridge@google.com> Adding smoke test for new hybrid params (#8937) * Adding smoke test for new hybrid params * Use the existing name of the model params input --------- Co-authored-by: Erik Eldridge <erikeldridge@google.com> Moving to in-cloud naming (#8938) Co-authored-by: Erik Eldridge <erikeldridge@google.com> Moving to string type for the inference mode (#8941) Define ChromeAdapter class (#8942) Co-authored-by: Erik Eldridge <erikeldridge@google.com> VinF Hybrid Inference: Implement ChromeAdapter (rebased) (#8943) Adding count token impl (#8950) VinF Hybrid Inference #4: ChromeAdapter in stream methods (rebased) (#8949) Define values for Availability enum (#8951) VinF Hybrid Inference: narrow Chrome input type (#8953) Add image inference support (#8954) * Adding image based input for inference * adding image as input to create language model object disable count tokens api for on-device inference (#8962) VinF Hybrid Inference: throw if only_on_device and model is unavailable (#8965) VinF Hybrid Inference: update docs (#8970) VinF Hybrid Inference: consolidate onDeviceParams initialization (#8969) VinF Hybrid Inference: disable multi-turn support (#8973) VinF Hybrid Inference: remove default expected input types (#8974) VinF Hybrid Inference: set image (and text) as default input type (#8984) VinF Hybrid Inference: log debug messages in conditional logic (#8992)
Problem: we're currently falling back to Cloud even if the mode is only_on_device.
Proposal:
Also: remove stale tests for systemInstruction; I added a backlog item for figuring out if we want to honor systemInstruction passed in the request vs onDeviceParams.