Suggestion: Snap the "Candidates" slider to integer values #3

Closed
opened 2023-02-05 04:20:20 +00:00 by sakharam_gatne · 6 comments

I would have created a pull request for this, but unfortunately my code is a mess right now. Changing line 132 in app.py from this:
candidates = gr.Slider(value=1, minimum=1, maximum=6, label="Candidates")
to this:
candidates = gr.Slider(value=1, minimum=1, maximum=6, step=1, label="Candidates")
will make the progressbar snap to increments of one.

Just a small change that might make it more user-friendly.

I'm also in the process of modifying app.py so it can process bigger text by breaking it down into chunks, similar to read.py in the original script (also works for multiple candidates). I'll try a pull request when I'm done.

I would have created a pull request for this, but unfortunately my code is a mess right now. Changing line 132 in app.py from this: `candidates = gr.Slider(value=1, minimum=1, maximum=6, label="Candidates")` to this: `candidates = gr.Slider(value=1, minimum=1, maximum=6, step=1, label="Candidates")` will make the progressbar snap to increments of one. Just a small change that might make it more user-friendly. I'm also in the process of modifying app.py so it can process bigger text by breaking it down into chunks, similar to read.py in the original script (also works for multiple candidates). I'll try a pull request when I'm done.
Owner

Added in commit cab32e1f45 ; desu I don't think I ever actually used the Candidates slider to see it defaults as a float, my bad.

I'm also in the process of modifying app.py so it can process bigger text by breaking it down into chunks, similar to read.py in the original script (also works for multiple candidates).

That was on my mind the other day, at the very least to add an option to split by a user-provided delimiter. I suppose if you're working on that then, I'll leave it in your hands.

Added in commit cab32e1f45c1933eee3c888232c9aeff71022adb ; desu I don't think I ever actually used the `Candidates` slider to see it defaults as a float, my bad. >I'm also in the process of modifying app.py so it can process bigger text by breaking it down into chunks, similar to read.py in the original script (also works for multiple candidates). That was on my mind the other day, at the very least to add an option to split by a user-provided delimiter. I suppose if you're working on that then, I'll leave it in your hands.
Author

EDIT: I saw you just patched the bug, testing on the latest commit now.

Okay I think I have the code working now.

However there's a problem in the latest commit where regardless of what sample and iteration values you set, it sets it to "512" during generation.

I know this is unprofessional, but I can't figure out how to create a pull request so I'm gonna do a manual "git-diff" for you.

  1. After Line 10 add this:
    from tortoise.utils.text import split_and_recombine_text

  2. In def inference(), after the curly brace at line 56, delete everything in the function and replace it with this: https://pastebin.com/yS1MwQQa

I can't test this on the latest commit due to the bug I mentioned above (it'll take a ridiculously long time to generate), but I've tested it on 5c876b81f3 and it works.

EDIT: I saw you just patched the bug, testing on the latest commit now. Okay I think I have the code working now. **However there's a problem in the latest commit where regardless of what sample and iteration values you set, it sets it to "512" during generation.** I know this is unprofessional, but I can't figure out how to create a pull request so I'm gonna do a manual "git-diff" for you. 1. After Line 10 add this: `from tortoise.utils.text import split_and_recombine_text` 2. In `def inference()`, after the curly brace at line 56, delete everything in the function and replace it with this: https://pastebin.com/yS1MwQQa I can't test this on the latest commit due to the bug I mentioned above (it'll take a ridiculously long time to generate), but I've tested it on 5c876b81f3 and it works.
Owner

However there's a problem in the latest commit where regardless of what sample and iteration values you set, it sets it to "512" during generation.

Already ahead of you, fixed it. When I was moving handling presets, I neglected to pass those back in.

I know this is unprofessional, but I can't figure out how to create a pull request so I'm gonna do a manual "git-diff" for you.

No worries, I never figured out how to anything involving PRs. I'll finagle with it.

>However there's a problem in the latest commit where regardless of what sample and iteration values you set, it sets it to "512" during generation. Already ahead of you, fixed it. When I was moving handling presets, I neglected to pass those back in. >I know this is unprofessional, but I can't figure out how to create a pull request so I'm gonna do a manual "git-diff" for you. No worries, I never figured out how to anything involving PRs. I'll finagle with it.
Author

I just realized there was an error in my code that screwed up single-candidate outputs, but you seem to have caught and fixed it.
Just one suggestion before I close this issue, adding tortoise/voices to .gitignore will be convenient for people making pull requests, as it'll ignore their custom datasets.

I just realized there was an error in my code that screwed up single-candidate outputs, but you seem to have caught and fixed it. Just one suggestion before I close this issue, adding `tortoise/voices` to `.gitignore` will be convenient for people making pull requests, as it'll ignore their custom datasets.
Owner

Added.

In bf32efe503 :

  • had to fix a case with it breaking on candidates=1
  • did some cleanup for the printed messages
  • had the string to split by a user-entered value as Line Delimiter, with an option to do new lines

In bc567d7263 :

  • skip the combining step if not necessary
  • skip reading back the audio files from disk by lazily storing it to a dict
Added. In bf32efe5038089beb0ccfbade50e290d886827fc : * had to fix a case with it breaking on candidates=1 * did some cleanup for the printed messages * had the string to split by a user-entered value as `Line Delimiter`, with an option to do new lines In bc567d72632c39cd4047bdb77bab83e17381d75f : * skip the combining step if not necessary * skip reading back the audio files from disk by lazily storing it to a dict
Author

Thanks a lot!

Thanks a lot!
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/tortoise-tts#3
No description provided.