Skip to content

Commit 31c7f0e

Browse files
Merge pull request #144 from EMCP/master
Making compliant pathes for linux and windows OS
2 parents 064c381 + 6605d1e commit 31c7f0e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

chatbot/chatbot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ def __init__(self):
6666
self.sess = None
6767

6868
# Filename and directories constants
69-
self.MODEL_DIR_BASE = 'save/model'
69+
self.MODEL_DIR_BASE = 'save' + os.sep + 'model'
7070
self.MODEL_NAME_BASE = 'model'
7171
self.MODEL_EXT = '.ckpt'
7272
self.CONFIG_FILENAME = 'params.ini'
7373
self.CONFIG_VERSION = '0.5'
74-
self.TEST_IN_NAME = 'data/test/samples.txt'
74+
self.TEST_IN_NAME = 'data' + os.sep + 'test' + os.sep + 'samples.txt'
7575
self.TEST_OUT_SUFFIX = '_predictions.txt'
7676
self.SENTENCES_PREFIX = ['Q: ', 'A: ']
7777

chatbot/textdata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def _printStats(self):
108108
def _constructBasePath(self):
109109
"""Return the name of the base prefix of the current dataset
110110
"""
111-
path = os.path.join(self.args.rootDir, 'data/samples/')
111+
path = os.path.join(self.args.rootDir, 'data' + os.sep + 'samples' + os.sep)
112112
path += 'dataset-{}'.format(self.args.corpus)
113113
if self.args.datasetTag:
114114
path += '-' + self.args.datasetTag
@@ -254,7 +254,7 @@ def loadCorpus(self):
254254
if self.args.corpus == 'lightweight':
255255
if not self.args.datasetTag:
256256
raise ValueError('Use the --datasetTag to define the lightweight file to use.')
257-
optional = '/' + self.args.datasetTag # HACK: Forward the filename
257+
optional = os.sep + self.args.datasetTag # HACK: Forward the filename
258258

259259
# Corpus creation
260260
corpusData = TextData.availableCorpus[self.args.corpus](self.corpusDir + optional)

0 commit comments

Comments
 (0)