Skip to content

Commit

Permalink
fix python path when running CLI scripts in Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sebovzeoueb committed Mar 13, 2024
1 parent 11930cc commit 910901c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
9 changes: 9 additions & 0 deletions cli/loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import platform
import sys

my_platform = platform.system()

if my_platform == "Linux": # relative imports don't work the same on Windows and Linux!
sys.path.append('..')
# TODO: check MacOS

import os
from loaders.pdf import load_pdf
from concierge_backend_lib.collections import init_collection
Expand Down
11 changes: 9 additions & 2 deletions cli/prompter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import platform
import sys

my_platform = platform.system()

if my_platform == "Linux": # relative imports don't work the same on Windows and Linux!
sys.path.append('..')
# TODO: check MacOS

import os
from sentence_transformers import SentenceTransformer
import argparse
Expand All @@ -6,8 +15,6 @@
from concierge_backend_lib.collections import get_existing_collection
from concierge_backend_lib.prompting import load_model, get_context, get_response

# TODO add collection as an option
# TODO make these be web inputs for streamlit
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--task", required=True,
help="Required: What you want Concierge to do.")
Expand Down
9 changes: 9 additions & 0 deletions cli/web-loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import platform
import sys

my_platform = platform.system()

if my_platform == "Linux": # relative imports don't work the same on Windows and Linux!
sys.path.append('..')
# TODO: check MacOS

from loaders.web import load_web
from concierge_backend_lib.collections import init_collection
from concierge_backend_lib.ingesting import insert_with_tqdm
Expand Down

0 comments on commit 910901c

Please sign in to comment.