mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-25 05:48:55 +01:00
Merge pull request #275 from stefanhamburger/patch-1
Fix: tuple object does not support item assignment
This commit is contained in:
commit
b6098e9ccb
@ -57,7 +57,7 @@ def remove_surrounded_chars(string):
|
|||||||
|
|
||||||
def remove_tts_from_history(name1, name2):
|
def remove_tts_from_history(name1, name2):
|
||||||
for i, entry in enumerate(shared.history['internal']):
|
for i, entry in enumerate(shared.history['internal']):
|
||||||
shared.history['visible'][i][1] = entry[1]
|
shared.history['visible'][i] = [shared.history['visible'][i][0], entry[1]]
|
||||||
return chat.generate_chat_output(shared.history['visible'], name1, name2, shared.character)
|
return chat.generate_chat_output(shared.history['visible'], name1, name2, shared.character)
|
||||||
|
|
||||||
def toggle_text_in_history(name1, name2):
|
def toggle_text_in_history(name1, name2):
|
||||||
@ -66,9 +66,9 @@ def toggle_text_in_history(name1, name2):
|
|||||||
if visible_reply.startswith('<audio'):
|
if visible_reply.startswith('<audio'):
|
||||||
if params['show_text']:
|
if params['show_text']:
|
||||||
reply = shared.history['internal'][i][1]
|
reply = shared.history['internal'][i][1]
|
||||||
shared.history['visible'][i][1] = f"{visible_reply.split('</audio>')[0]}</audio>\n\n{reply}"
|
shared.history['visible'][i] = [shared.history['visible'][i][0], f"{visible_reply.split('</audio>')[0]}</audio>\n\n{reply}"]
|
||||||
else:
|
else:
|
||||||
shared.history['visible'][i][1] = f"{visible_reply.split('</audio>')[0]}</audio>"
|
shared.history['visible'][i] = [shared.history['visible'][i][0], f"{visible_reply.split('</audio>')[0]}</audio>"]
|
||||||
return chat.generate_chat_output(shared.history['visible'], name1, name2, shared.character)
|
return chat.generate_chat_output(shared.history['visible'], name1, name2, shared.character)
|
||||||
|
|
||||||
def input_modifier(string):
|
def input_modifier(string):
|
||||||
@ -79,7 +79,7 @@ def input_modifier(string):
|
|||||||
|
|
||||||
# Remove autoplay from the last reply
|
# Remove autoplay from the last reply
|
||||||
if (shared.args.chat or shared.args.cai_chat) and len(shared.history['internal']) > 0:
|
if (shared.args.chat or shared.args.cai_chat) and len(shared.history['internal']) > 0:
|
||||||
shared.history['visible'][-1][1] = shared.history['visible'][-1][1].replace('controls autoplay>','controls>')
|
shared.history['visible'][-1] = [shared.history['visible'][-1][0], shared.history['visible'][-1][1].replace('controls autoplay>','controls>')]
|
||||||
|
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user