Skip to content

Commit 68b8b5d

Browse files
fix: parsing of arguments for string filetype
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent cbb2903 commit 68b8b5d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

wdoc/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def cli_launcher() -> None:
5959
sys.argv[1] = aft
6060

6161
# make it so that 'wdoc --task=query THING' becomes 'wdoc --task=query --path=THING'
62-
if "--path" not in sysline:
62+
if "--path" not in sysline and "string" not in sysline: # if string is present that can be because of filetype=string, in which case path is not needed
6363
path = sys.argv[2]
6464
newarg = f"--path={path}"
6565
sys.argv[2]= newarg

wdoc/utils/loaders.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ def load_one_doc(
390390
split into documents, add some metadata then return.
391391
The loader is cached"""
392392
text_splitter = get_splitter(task, modelname=llm_name)
393-
assert kwargs, "Received an empty dict of arguments to load. Maybe --path is empty?"
393+
if filetype != "string": # only filetype that can take empty arguments
394+
assert kwargs, "Received an empty dict of arguments to load. Maybe --path is empty?"
394395

395396
expected_global_dir = loaders_temp_dir_file.read_text().strip()
396397
assert expected_global_dir, f"Empty loaders_temp_dir_file at {loaders_temp_dir_file}"

0 commit comments

Comments
 (0)