mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-06 19:09:16 +00:00
fixed accents problem
This commit is contained in:
parent
8a19ba2ac7
commit
f297ac9779
@ -1040,11 +1040,13 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
# Create a string containing all punctuation characters
|
# Create a string containing all punctuation characters
|
||||||
punctuation_chars = string.punctuation
|
punctuation_chars = string.punctuation
|
||||||
# Define a regular expression pattern to match and remove non-alphanumeric characters
|
# Define a regular expression pattern to match and remove non-alphanumeric characters
|
||||||
pattern = f'[^a-zA-Z0-9\s{re.escape(punctuation_chars)}]' # This pattern matches any character that is not a letter, digit, space, or punctuation
|
#pattern = f'[^a-zA-Z0-9\s{re.escape(punctuation_chars)}]' # This pattern matches any character that is not a letter, digit, space, or punctuation
|
||||||
|
pattern = f'[^a-zA-Z0-9\u00C0-\u017F\s{re.escape(punctuation_chars)}]'
|
||||||
# Use re.sub to replace the matched characters with an empty string
|
# Use re.sub to replace the matched characters with an empty string
|
||||||
cleaned_string = re.sub(pattern, '', cleaned_string)
|
cleaned_string = re.sub(pattern, '', cleaned_string)
|
||||||
return cleaned_string
|
return cleaned_string
|
||||||
|
|
||||||
|
|
||||||
def prepare_query(self, client_id, message_id=-1, is_continue=False):
|
def prepare_query(self, client_id, message_id=-1, is_continue=False):
|
||||||
messages = self.connections[client_id]["current_discussion"].get_messages()
|
messages = self.connections[client_id]["current_discussion"].get_messages()
|
||||||
full_message_list = []
|
full_message_list = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user