ga89tiy
commited on
Commit
•
6a93830
1
Parent(s):
71b35d2
readme
Browse files
README.md
CHANGED
@@ -30,7 +30,6 @@ library_name: transformers
|
|
30 |
Clone repository:
|
31 |
```python
|
32 |
git clone https://huggingface.co/Chantal/RaDialog-interactive-radiology-report-generation
|
33 |
-
cd RaDialog-interactive-radiology-report-generation
|
34 |
```
|
35 |
|
36 |
Install requirements:
|
@@ -67,7 +66,7 @@ def load_model_from_huggingface(repo_id):
|
|
67 |
model_path = Path(model_path)
|
68 |
|
69 |
tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, model_base='liuhaotian/llava-v1.5-7b',
|
70 |
-
model_name="llava-v1.5-7b-task-lora_radialog_instruct_llava_biovil_unfrozen_2e-5_5epochs_v5_checkpoint-21000", load_8bit=False,
|
71 |
|
72 |
|
73 |
return tokenizer, model, image_processor, context_len
|
@@ -96,7 +95,7 @@ if __name__ == '__main__':
|
|
96 |
findings = ', '.join(findings).lower().strip()
|
97 |
|
98 |
conv = conv_vicuna_v1.copy()
|
99 |
-
REPORT_GEN_PROMPT = f"<image>. Predicted Findings: {findings}. You are to act as a radiologist and write the finding section of a chest x-ray radiology report for this X-ray image and the given
|
100 |
print("USER: ", REPORT_GEN_PROMPT)
|
101 |
conv.append_message("USER", REPORT_GEN_PROMPT)
|
102 |
conv.append_message("ASSISTANT", None)
|
@@ -171,6 +170,7 @@ if __name__ == '__main__':
|
|
171 |
|
172 |
pred = tokenizer.decode(output_ids[0, input_ids.shape[1]:]).strip().replace("</s>", "")
|
173 |
print("ASSISTANT: ", pred)
|
|
|
174 |
```
|
175 |
|
176 |
## ✏️ Citation
|
|
|
30 |
Clone repository:
|
31 |
```python
|
32 |
git clone https://huggingface.co/Chantal/RaDialog-interactive-radiology-report-generation
|
|
|
33 |
```
|
34 |
|
35 |
Install requirements:
|
|
|
66 |
model_path = Path(model_path)
|
67 |
|
68 |
tokenizer, model, image_processor, context_len = load_pretrained_model(model_path, model_base='liuhaotian/llava-v1.5-7b',
|
69 |
+
model_name="llava-v1.5-7b-task-lora_radialog_instruct_llava_biovil_unfrozen_2e-5_5epochs_v5_checkpoint-21000", load_8bit=False, load_4bit=False)
|
70 |
|
71 |
|
72 |
return tokenizer, model, image_processor, context_len
|
|
|
95 |
findings = ', '.join(findings).lower().strip()
|
96 |
|
97 |
conv = conv_vicuna_v1.copy()
|
98 |
+
REPORT_GEN_PROMPT = f"<image>. Predicted Findings: {findings}. You are to act as a radiologist and write the finding section of a chest x-ray radiology report for this X-ray image and the given predicted findings. Write in the style of a radiologist, write one fluent text without enumeration, be concise and don't provide explanations or reasons."
|
99 |
print("USER: ", REPORT_GEN_PROMPT)
|
100 |
conv.append_message("USER", REPORT_GEN_PROMPT)
|
101 |
conv.append_message("ASSISTANT", None)
|
|
|
170 |
|
171 |
pred = tokenizer.decode(output_ids[0, input_ids.shape[1]:]).strip().replace("</s>", "")
|
172 |
print("ASSISTANT: ", pred)
|
173 |
+
|
174 |
```
|
175 |
|
176 |
## ✏️ Citation
|