Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pip install structured-qa
structured-qa \
--question "What optimizer was used to train the model?" \
--input_file "example_data/1706.03762v7.pdf" \
--output_folder "example_outputs/1706.03762v7.pdf"
--output_dir "example_outputs/1706.03762v7.pdf"
```

### Graphical Interface App
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Or provide values to the arguments directly:
structured-qa \
--question "What learning rate was used?" \
--input_file "example_data/1706.03762v7.pdf" \
--output_folder "example_outputs/1706.03762v7.pdf"
--output_dir "example_outputs/1706.03762v7.pdf"
```

---
Expand Down
2 changes: 2 additions & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This Blueprint is designed to be flexible and easily adaptable to your specific

## 🖋️ **Customizable Parameters**

-- **`question`**: The question to be answered.

- **`input_file`**: The input file specifies the document to be processed. Supports the `pdf` format.

- **`output_dir`**: Path to the output directory where the extracted sections will be saved.
Expand Down
1 change: 1 addition & 0 deletions example_data/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
question: "What optimizer was used to train the model?"
input_file: example_data/1706.03762v7.pdf
output_dir: example_outputs/1706.03762v7.pdf
model: "bartowski/Qwen2.5-3B-Instruct-GGUF/Qwen2.5-3B-Instruct-f16.gguf"
Expand Down
3 changes: 2 additions & 1 deletion src/structured_qa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@logger.catch(reraise=True)
def structured_qa(
question: str,
question: str | None = None,
input_file: str | None = None,
output_dir: str | None = None,
model: str
Expand Down Expand Up @@ -57,6 +57,7 @@ def structured_qa(
else:
Path(output_dir).mkdir(exist_ok=True, parents=True)
config = Config(
question=question,
input_file=input_file,
output_dir=output_dir,
model=model,
Expand Down
1 change: 1 addition & 0 deletions src/structured_qa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def answer_prompt(value):


class Config(BaseModel):
question: str
input_file: FilePath
output_dir: DirectoryPath
model: Annotated[str, AfterValidator(validate_model)]
Expand Down