aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-02-23 10:07:50 -0600
committerAnthony Wang2022-02-23 10:07:50 -0600
commit94bd85860964b7999f0315e3691c2b6a4726c53c (patch)
treec569a41f82c0fe38069c77a8bb82e1cc777370fe
parent4c0afade32009f24b355eb5e4a52dcbf0e510b2f (diff)
Add flag for bot.py data
-rw-r--r--bot.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot.py b/bot.py
index 2ffb93d..7ec5231 100644
--- a/bot.py
+++ b/bot.py
@@ -9,6 +9,8 @@ parser = ArgumentParser()
parser.add_argument('-i', '--instance', help='Mastodon instance hosting the bot')
parser.add_argument('-t', '--token', help='Mastodon application access token')
parser.add_argument('-n', '--input', help='initial input text')
+parser.add_argument('-d', '--data', default='data',
+ help='data for automatic input generation')
parser.add_argument('-m', '--model', default='model',
help='path to load saved model')
args = parser.parse_args()
@@ -44,7 +46,7 @@ if args.input is None:
'I think'
])
else:
- with open('data', 'r') as f:
+ with open(args.data, 'r') as f:
line = choice(f.readlines()).split()
args.input = line[0] + ' ' + line[1]