CoolFace
Apppublic

kashishgupta/Crowd_sourced_FAQ_Project

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
cli.py28 linesDownload Raw Back to root
1from __future__ import annotations2import argparse3from rag.chain import answer4 5def main() -> None:6    parser = argparse.ArgumentParser(description="Run the FAQ RAG chatbot locally.")7    parser.add_argument("question", nargs="?", help="The question to answer from the FAQ knowledge base.")8    args = parser.parse_args()9 10    if args.question:11        print(answer(args.question))12        return13    14    try:15        while True:16            q = input("Question (type 'exit' to quit): ").strip()17            if not q:18                continue19            if q.lower() in {"exit", "quit"}:20                break21            print(answer(q))22    except (KeyboardInterrupt, EOFError):23        print("\nGoodbye")24 25 26if __name__ == "__main__":27    main()28