xtie commited on
Commit
55ca429
·
1 Parent(s): aa3f882

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -4
README.md CHANGED
@@ -39,11 +39,17 @@ findings_info =
39
  """
40
  Description: PET CT WHOLE BODY
41
  Radiologist: James
42
- Findings: Head/Neck: xxx Chest: xxx Abdomen/Pelvis: xxx Extremities/Musculoskeletal: xxx
43
- Indication: The patient is a 60-year old male with a history of xxx
 
 
44
  """
45
 
46
- inputs = tokenizer(findings_info.replace('\n', ' '), padding="max_length", truncation=True, max_length=1024, return_tensors="pt")
 
 
 
 
47
  input_ids = inputs.input_ids.to("cuda")
48
  attention_mask = inputs.attention_mask.to("cuda")
49
  outputs = model.generate(input_ids,
@@ -58,7 +64,9 @@ outputs = model.generate(input_ids,
58
  no_repeat_ngram_size=3,
59
  early_stopping=True
60
  )
61
- output_str = tokenizer.decode(outputs, skip_special_tokens=True) # get the generated impressions
 
 
62
  ```
63
 
64
 
 
39
  """
40
  Description: PET CT WHOLE BODY
41
  Radiologist: James
42
+ Findings:
43
+ Head/Neck: xxx Chest: xxx Abdomen/Pelvis: xxx Extremities/Musculoskeletal: xxx
44
+ Indication:
45
+ The patient is a 60-year old male with a history of xxx
46
  """
47
 
48
+ inputs = tokenizer(findings_info.replace('\n', ' '),
49
+ padding="max_length",
50
+ truncation=True,
51
+ max_length=1024,
52
+ return_tensors="pt")
53
  input_ids = inputs.input_ids.to("cuda")
54
  attention_mask = inputs.attention_mask.to("cuda")
55
  outputs = model.generate(input_ids,
 
64
  no_repeat_ngram_size=3,
65
  early_stopping=True
66
  )
67
+ # get the generated impressions
68
+ output_str = tokenizer.decode(outputs,
69
+ skip_special_tokens=True)
70
  ```
71
 
72