-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (23 loc) · 833 Bytes
/
main.py
File metadata and controls
30 lines (23 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from src.logger import logger
from src.config_parser import parse
from src.client import Gen_Client
from src.transform import GPT2_Transform, Postprocessor, Compose_Transform
import sys
# Set up logger
logger = logger()
# Parse config file
config_file = 'config.json'
if len(sys.argv)>1:
config_file = sys.argv[1]
config = parse(config_file)
# optional $github command will point to config['github']
# default just point to my repo.
github = config['github'] if 'github' in config else 'https://github.com/bwdGitHub/discord_gen'
# Set up transformer to use
transformer = GPT2_Transform(max_length=100)
postprocessor = Postprocessor()
postprocessed_transformer = Compose_Transform(transformer,postprocessor)
# Set up client
client = Gen_Client(postprocessed_transformer,github=github)
# Run
client.run(config['token'])