Skip to content

Commit 513fe1c

Browse files
authored
Merge pull request #14 from A-Baji/dev
fix path attempt
2 parents bc4427a + 0890b33 commit 513fe1c

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

discordai_modelizer/customize.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import subprocess
33
import appdirs
44
import shutil
5-
import sys
6-
from pkg_resources import resource_filename
75

8-
from discordai_modelizer import __name__ as pkg_name
96
from discordai_modelizer.gen_dataset import parse_logs, get_lines
107

118

@@ -21,14 +18,9 @@ def create_model(bot_token: str, openai_key: str, channel_id: str, user_id: str,
2118
print("INFO: This may take a few minutes to hours depending on the message count of the channel")
2219
print("INFO: Progress will NOT be saved if cancelled")
2320
print("--------------------------DiscordChatExporter---------------------------")
24-
try:
25-
# If running as an executable, use the extracted package data
26-
DiscordChatExporter = os.path.join(sys._MEIPASS, 'discordai_modelizer',
27-
'DiscordChatExporter', 'DiscordChatExporter.Cli.exe')
28-
except AttributeError:
29-
# If running as a Python package, use pkg_resources to locate the file
30-
DiscordChatExporter = resource_filename(
31-
'discordai_modelizer', 'DiscordChatExporter/DiscordChatExporter.Cli.exe')
21+
DiscordChatExporter = os.path.join(
22+
os.path.dirname(__file__),
23+
'DiscordChatExporter', 'DiscordChatExporter.Cli.exe')
3224
subprocess.run([
3325
DiscordChatExporter,
3426
"export",

0 commit comments

Comments
 (0)