Kigo commited on
Commit
2cd9431
1 Parent(s): 969deed

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -0
README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Best Generations with
2
+ ```
3
+ from transformers import OPTForCausalLM
4
+ from transformers import GPT2Tokenizer
5
+
6
+ model = OPTForCausalLM.from_pretrained("Kigo/OPT-350m-COVID-Finetune", from_tf=True)
7
+ tokenizer = GPT2Tokenizer.from_pretrained("facebook/opt-350m")
8
+
9
+ inputs = tokenizer("Covid-19 is Positive, 42.237% of Lungs show GGO, Lower Left Lobe was most affected, Upper Left Lobe was least affected, yes Vascular dilatation, found consolidation. The patient is in critical condition. \n\n\n ", return_tensors="pt")
10
+
11
+ generate_ids = model.generate(inputs.input_ids,
12
+ do_sample=True,
13
+ max_new_tokens=1000,
14
+ top_k=50,
15
+ top_p=0.95,
16
+ )
17
+ completion = tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
18
+ print(completion)
19
+ ```