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 found that stopping stream is currently not possible with the provided huggingface-stream.ts package and Hf.textGenerationStream method.
I've currently implemented by creating a custom fetch with abort controller and passing it as argument to Hf.textGenerationStream, and adding a try-catch block to huggingface-stream.ts to catch the user cancel operation and signal the abort controller. I'm looking for help if there are any better solutions, or happy to raise PR with these changes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I found that stopping stream is currently not possible with the provided
huggingface-stream.ts
package andHf.textGenerationStream
method.I've currently implemented by creating a custom fetch with abort controller and passing it as argument to
Hf.textGenerationStream
, and adding a try-catch block tohuggingface-stream.ts
to catch the user cancel operation and signal the abort controller. I'm looking for help if there are any better solutions, or happy to raise PR with these changes.Beta Was this translation helpful? Give feedback.
All reactions