37 lines
1020 B
Python
37 lines
1020 B
Python
#!/usr/bin/env python3
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(os.environ.get("GENE_FAMILY_ROOT", "/data/gene-family-mas-v2"))
|
|
GF = Path(os.environ.get("GFANALYSIS_ROOT", "/data/wutx/00test/gfAnalysis"))
|
|
for path in (ROOT, GF):
|
|
if str(path) not in sys.path:
|
|
sys.path.insert(0, str(path))
|
|
|
|
from src.rag.qa_v1_0_0.pipeline import QAV1Pipeline
|
|
|
|
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("question")
|
|
parser.add_argument("--no-draft", action="store_true")
|
|
parser.add_argument("--max-rounds", type=int, default=2)
|
|
parser.add_argument("--debug", action="store_true")
|
|
args = parser.parse_args()
|
|
response = QAV1Pipeline().answer(
|
|
args.question,
|
|
debug=args.debug,
|
|
use_provisional_draft=not args.no_draft,
|
|
max_rounds=args.max_rounds,
|
|
)
|
|
print(json.dumps(response, ensure_ascii=False, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|