generated from adham-elarabawy/lean-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
e2e.py
28 lines (21 loc) · 870 Bytes
/
e2e.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import logging
from calendar import c
from multiprocessing import process
from rich.console import Console
from rich.logging import RichHandler
from src.llvim.answer import process_extraction_request
from src.llvim.answer_utils import LLVIMConfig
def main(console: Console):
with open("static/hamming.txt") as f:
document_text = f.read()
config = LLVIMConfig(window_height=100, verbatim_mode=True)
query = "the blurb about newton and edison"
extracted_content = process_extraction_request(
document_text, query, config=config
)
console.print(f"[purple][bold]Query:[/bold][/purple]\n{query}")
console.print(f"[purple][bold]Extracted content:[/bold][/purple]\n{extracted_content}")
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, handlers=[RichHandler()])
console = Console()
main(console)