From 63fb645a3db3ff3482b26741f3934284742821a5 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Mon, 24 Jul 2023 11:33:54 +0200 Subject: [PATCH] add debugging info --- tutorials/llm_clinical_trials/falcon_requirements.txt | 5 +++-- tutorials/llm_clinical_trials/project.yml | 2 +- .../llm_clinical_trials/scripts/visualise_entities.py | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tutorials/llm_clinical_trials/falcon_requirements.txt b/tutorials/llm_clinical_trials/falcon_requirements.txt index 6bbb8493..3be11019 100644 --- a/tutorials/llm_clinical_trials/falcon_requirements.txt +++ b/tutorials/llm_clinical_trials/falcon_requirements.txt @@ -1,4 +1,5 @@ cupy-cuda117 -torch==1.13.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html +torch==2.0.1+cu117 -f https://download.pytorch.org/whl/torch_stable.html transformers -einops \ No newline at end of file +einops +xformers \ No newline at end of file diff --git a/tutorials/llm_clinical_trials/project.yml b/tutorials/llm_clinical_trials/project.yml index 0f33a797..55041304 100644 --- a/tutorials/llm_clinical_trials/project.yml +++ b/tutorials/llm_clinical_trials/project.yml @@ -2,7 +2,7 @@ title: 'Clinical trial results extraction with LLMs' description: "Using an LLM in a spaCy pipeline to extract patient groups, treatments and outcomes in clinical trials." vars: - ner_config: "ner_dolly.cfg" # "ner_falcon.cfg" # "ner_openai.cfg" + ner_config: "ner_falcon.cfg" # "ner_dolly.cfg" # "ner_openai.cfg" trial_config: "trial_openai.cfg" pmid: 27144689 diff --git a/tutorials/llm_clinical_trials/scripts/visualise_entities.py b/tutorials/llm_clinical_trials/scripts/visualise_entities.py index da8c0653..12b063ca 100644 --- a/tutorials/llm_clinical_trials/scripts/visualise_entities.py +++ b/tutorials/llm_clinical_trials/scripts/visualise_entities.py @@ -8,8 +8,14 @@ def visualise_entities(pmid: int, config_path: Path, verbose: bool = False): - msg.text(f"Processing PMID {pmid}", show=verbose) - msg.text(f"Loading config from {config_path}", show=verbose) + import logging + import spacy_llm + + spacy_llm.logger.addHandler(logging.StreamHandler()) + spacy_llm.logger.setLevel(logging.DEBUG) + + #msg.text(f"Processing PMID {pmid}", show=verbose) + #msg.text(f"Loading config from {config_path}", show=verbose) text = read_trial(pmid, verbose=verbose) nlp = assemble(config_path) doc = nlp(text)