Download main.py from Fuzure/sheami: direct link, hf CLI and curl.
- Browser
- Download file 918 Bytes
-
https://huggingface.co/spaces/Fuzure/sheami/resolve/main/main.py
- Command line
-
hf download hf://spaces/Fuzure/sheami/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Fuzure/sheami/resolve/main/main.py
918 Bytes
| from dotenv import load_dotenv | |
| import uuid | |
| from graph import HealthReport, SheamiState, create_graph | |
| from pdf_reader import read_pdf | |
| load_dotenv(override=True) | |
| def main(): | |
| print("Hello from sheami!") | |
| workflow = create_graph(thread_id="my_console_thread") | |
| report_file_names = [ | |
| "./data/jg/report_001.pdf", | |
| "./data/jg/report_002.pdf", | |
| "./data/jg/report_003.pdf", | |
| "./data/jg/report_005.pdf", | |
| "./data/jg/report_006.pdf", | |
| ] | |
| state = SheamiState( | |
| uploaded_reports=[ | |
| HealthReport( | |
| report_file_name=file_name, report_contents=read_pdf(file_name) | |
| ) | |
| for file_name in report_file_names | |
| ] | |
| ) | |
| config = {"configurable": {"thread_id": str(uuid.uuid4())}} | |
| response = workflow.invoke(state, config=config) | |
| # print(response) | |
| print("**All done**") | |
| if __name__ == "__main__": | |
| main() | |