You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Xenova/LaMini-Flan-T5-783M for a simple RAG pipeline in SemanticFinder and it works like a charm on the first call. Whenever I want to run a second query, i.e. running the same model again I get the following error "out of bounds/range".
For reproduction, simply click Find in SemanticFinder, then Chat, wait for the output to appear and then a second time Chat.
lettokenizer;letchatModel='Xenova/LaMini-Flan-T5-783M';asyncfunctiontoken_to_text(beams){letchatTokenizer=awaitAutoTokenizer.from_pretrained(chatModel);letdecoded_text=chatTokenizer.decode(beams[0].output_token_ids,{skip_special_tokens: true});console.log(decoded_text);returndecoded_text}// other code case'chat':
text=message.text.trim()letmax_new_tokens=message.max_new_tokensconsole.log(max_new_tokens,chatModel,text)letchatGenerator=awaitpipeline('text2text-generation',chatModel,{progress_callback: data=>{self.postMessage({type: 'chat_download',
data
});}});letthisChat=awaitchatGenerator(text,{max_new_tokens: max_new_tokens,return_prompt: false,callback_function: asyncfunction(beams){//console.log(beams);constdecodedText=token_to_text(beams)console.log(decodedText);}});self.postMessage({type: 'chat',chat: thisChat});break;
I was hesitant to create an issue here because I thought it was related to my code but it's weird that it's actually creating the first token of the answer and then fails. Also, I tested with e.g. Xenova/t5-small for text2text and didn't encounter the problem.
Is it possible that there is some kind of memory issue here?
The text was updated successfully, but these errors were encountered:
Hi! It seems to be the same case from #8 (comment); the solution, as Xenova mentions, is to call await pipeline() only once during the execution of the app.
And you probably didn't encounter the problem with Xenova/t5-small because it's small, and you haven't instantiated it enough times to fill up the memory.
Argh, that totally makes sense, thank you! I should have better searched through the closed issues too 🤦
So I had the same issue all along in the summary function too, only that the model is small enough to be instantiated several times...
Thanks for the nice words! :)
I am using Xenova/LaMini-Flan-T5-783M for a simple RAG pipeline in SemanticFinder and it works like a charm on the first call. Whenever I want to run a second query, i.e. running the same model again I get the following error "out of bounds/range".
For reproduction, simply click
Find
in SemanticFinder, thenChat
, wait for the output to appear and then a second timeChat
.Chrome:
Firefox:
I'm using transformers.js 2.6.2.
The
worker.js
here is pretty standard:I was hesitant to create an issue here because I thought it was related to my code but it's weird that it's actually creating the first token of the answer and then fails. Also, I tested with e.g.
Xenova/t5-small
for text2text and didn't encounter the problem.Is it possible that there is some kind of memory issue here?
The text was updated successfully, but these errors were encountered: