Skip to content

Commit b783aa0

Browse files
authored
Merge pull request #37 from A-Baji/dev
fix punctuation
2 parents a2b2815 + c1075bf commit b783aa0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

discordai_modelizer/gen_dataset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from json import load, dumps
44
from datetime import timedelta
55
from dateutil import parser
6+
from string import punctuation
67
import pathlib
78

89
def parse_logs(file: str, channel:str, user: str, thought_time=10, thought_max: int = None, thought_min=4):
@@ -34,7 +35,7 @@ def parse_logs(file: str, channel:str, user: str, thought_time=10, thought_max:
3435
dataset.write(
3536
dumps(
3637
{'prompt': '', 'completion': f'{thought}'
37-
if thought[-1] == '.' else f'{thought}.'}) + "\n")
38+
if thought[-1] in punctuation else f'{thought}.'}) + "\n")
3839
thought = msg['content'] if msg['content'][
3940
0] == ' ' else f" {msg['content']}"
4041
else:

discordai_modelizer/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.2.1"
1+
__version__ = "1.2.2"

0 commit comments

Comments
 (0)