Some minor formatting changes

This commit is contained in:
oobabooga 2023-02-18 11:07:55 -03:00
parent 3e6a8ccdce
commit d58544a420
2 changed files with 6 additions and 3 deletions

View File

@ -86,10 +86,10 @@ def generate_4chan_html(f):
margin-top: 4px; margin-top: 4px;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;
padding-bottom: 2px; padding-bottom: 4px;
padding-left: 2px; padding-left: 2px;
padding-right: 2px; padding-right: 2px;
padding-top: 2px; padding-top: 4px;
} }
#parent #container .number { #parent #container .number {
@ -97,6 +97,7 @@ def generate_4chan_html(f):
font-family: arial, helvetica, sans-serif; font-family: arial, helvetica, sans-serif;
font-size: 13.3333px; font-size: 13.3333px;
width: 342.65px; width: 342.65px;
margin-right: 7px;
} }
#parent #container .op { #parent #container .op {

View File

@ -250,6 +250,8 @@ def fix_galactica(s):
s = s.replace(r'\(', r'$') s = s.replace(r'\(', r'$')
s = s.replace(r'\)', r'$') s = s.replace(r'\)', r'$')
s = s.replace(r'$$', r'$') s = s.replace(r'$$', r'$')
s = re.sub(r'\n', r'\n\n', s)
s = re.sub(r"\n{3,}", "\n\n", s)
return s return s
def get_max_prompt_length(tokens): def get_max_prompt_length(tokens):
@ -755,7 +757,7 @@ def save_history(timestamp=True):
if not Path('logs').exists(): if not Path('logs').exists():
Path('logs').mkdir() Path('logs').mkdir()
with open(Path(f'logs/{fname}'), 'w') as f: with open(Path(f'logs/{fname}'), 'w') as f:
f.write(json.dumps({'data': history['internal'], 'data_visible': history['visible']})) f.write(json.dumps({'data': history['internal'], 'data_visible': history['visible']}, indent=2))
return Path(f'logs/{fname}') return Path(f'logs/{fname}')
def load_history(file, name1, name2): def load_history(file, name1, name2):