Jeremy Ellis
unread,Sep 16, 2025, 9:40:06 AM (13 days ago) Sep 16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chrome Built-in AI Early Preview Program Discussions, Thomas Steiner, Chrome Built-in AI Early Preview Program Discussions, Connie Leung, François Beaufort, Jeremy Ellis
Thanks for trying Thomas. Even with topk and temperate I am still getting errors that the model is not available. Any other suggestions? Here is my slightly changed code
```
<audio controls preload="auto"><source src="hello.mp3" /></audio>
<button id="button" type="button">Transcribe</button>
<output id="output"></output>
<script type="module">
button.addEventListener('click', async () => {
const blob = await fetch('hello.mp3').then((response) => response.blob());
output.textContent = '';
const session = await LanguageModel.create({
topK: 3, // Example: only consider the 3 most likely next words at each step.
temperature: 0.0, // Added the temperature parameter to fix the error.
expectedInputs: [{ type: 'audio' }, { type: 'text', languages: ['en'] }],
expectedOutputs: [{ type: 'text', languages: ['en'] }],
});
const stream = session.promptStreaming([
{
role: 'user',
content: [
{
type: 'audio',
value: blob,
},
{
type: 'text',
value: 'Transcribe this audio file.',
},
],
},
]);
for await (const chunk of stream) {
output.append(chunk);
}
});
</script>
```