Fix loading latest history for file names with dots#5162
Merged
Conversation
Owner
|
That's correct, I didn't notice that |
PoetOnTheRun
pushed a commit
to PoetOnTheRun/text-generation-webui
that referenced
this pull request
Feb 22, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the most recent chat or instruct log is loaded, it fails when the file name has a dot in it. This seems to happen because
.stemis being used twice:https://github.com/oobabooga/text-generation-webui/blob/894e1a070067a7d9f22b032b53cdd3a3528dce53/modules/chat.py#L496 https://github.com/oobabooga/text-generation-webui/blob/894e1a070067a7d9f22b032b53cdd3a3528dce53/modules/chat.py#L513
The fix
Remove the extra
.stemand use the "unique id" that comes fromfind_all_historiesas is.I've tested the fix in several ways, including crazy file names and directory junctions, but I'd love to hear if I missed some important reason for why the
Path(...).stemwas there.Error logs
Starting up Webui, most recent history is named
This.File.Name.Has.Several.Dots.json.Checklist