Skip to content

How to mute text betwen asterisks ? #157

Answered by KoljaB
Wuzzooy asked this question in Q&A
Discussion options

You must be logged in to vote

Two ways I can think of to achieve this:

  1. Change CharIterator in threadsafe_generators.py
    • check each character in the next method for *
    • remember if a * occured and discard all chars (not return them) until the next * occurs
  2. Write an own generator to wrap the generator from the LLM
    • retrieve the token from the LLM
    • check the token char by char for *, again remember and not yield in between *s
    • yield all chars from that token outside of *s

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@KoljaB
Comment options

Answer selected by Wuzzooy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants