Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 20815ad

Browse files
committed
Path relative to script file
1 parent 2549fc7 commit 20815ad

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

examples/dump_sentences.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313

1414
import argparse
1515
import logging
16+
import os
1617
import sys
1718

1819
# Set PATHs
19-
PATH_TO_SENTEVAL = '../'
20-
PATH_TO_DATA = '../data'
20+
PATH_TO_SENTEVAL = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
21+
PATH_TO_DATA = os.path.join(PATH_TO_SENTEVAL, 'data')
2122

2223
sys.path.insert(0, PATH_TO_SENTEVAL)
2324
import senteval

examples/eval_saved.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
import argparse
1515
import json
1616
import logging
17+
import os
1718
import sys
1819

1920
import numpy as np
2021

2122
# Set PATHs
22-
PATH_TO_SENTEVAL = '../'
23-
PATH_TO_DATA = '../data'
23+
PATH_TO_SENTEVAL = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
24+
PATH_TO_DATA = os.path.join(PATH_TO_SENTEVAL, 'data')
2425

2526
sys.path.insert(0, PATH_TO_SENTEVAL)
2627
import senteval

0 commit comments

Comments
 (0)