Improve example dialogue handling
This commit is contained in:
@@ -161,7 +161,7 @@ def generate_4chan_html(f):
|
||||
|
||||
return output
|
||||
|
||||
def generate_chat_html(_history, name1, name2, character):
|
||||
def generate_chat_html(history, name1, name2, character):
|
||||
css = """
|
||||
.chat {
|
||||
margin-left: auto;
|
||||
@@ -234,13 +234,6 @@ def generate_chat_html(_history, name1, name2, character):
|
||||
img = f'<img src="file/{i}">'
|
||||
break
|
||||
|
||||
history = copy.deepcopy(_history)
|
||||
for i in range(len(history)):
|
||||
if '<|BEGIN-VISIBLE-CHAT|>' in history[i][0]:
|
||||
history[i][0] = history[i][0].replace('<|BEGIN-VISIBLE-CHAT|>', '')
|
||||
history = history[i:]
|
||||
break
|
||||
|
||||
for i,_row in enumerate(history[::-1]):
|
||||
row = _row.copy()
|
||||
row[0] = re.sub(r"[\\]*\*", r"*", row[0])
|
||||
|
||||
Reference in New Issue
Block a user