jolenechong commited on
Commit
c88b3ed
1 Parent(s): a46bdf3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -2
README.md CHANGED
@@ -1,8 +1,6 @@
1
  ---
2
  license: mit
3
  base_model: facebook/bart-large-cnn
4
- tags:
5
- - generated_from_trainer
6
  model-index:
7
  - name: lora-bart-cnn-tib-1024
8
  results: []
@@ -44,6 +42,24 @@ Artificial Intelligence (AI) has become ingrained in our daily lives, from voice
44
 
45
  Intended for summarizing video conferences/webinars.
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  ## Training and evaluation data
48
 
49
  More information needed
 
1
  ---
2
  license: mit
3
  base_model: facebook/bart-large-cnn
 
 
4
  model-index:
5
  - name: lora-bart-cnn-tib-1024
6
  results: []
 
42
 
43
  Intended for summarizing video conferences/webinars.
44
 
45
+ Try out the model with the code below :D
46
+ ```python
47
+ from peft import PeftModel, PeftConfig
48
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
49
+
50
+ config = PeftConfig.from_pretrained("jolenechong/lora-bart-samsum-tib-1024")
51
+ model = AutoModelForSeq2SeqLM.from_pretrained("philschmid/bart-large-cnn-samsum")
52
+ model = PeftModel.from_pretrained(model, "jolenechong/lora-bart-samsum-tib-1024")
53
+ tokenizer = AutoTokenizer.from_pretrained("jolenechong/lora-bart-samsum-tib-1024", from_pt=True)
54
+
55
+ text = """[add transcript you want to summarize here]"""
56
+ inputs = tokenizer(text, return_tensors="pt")
57
+
58
+ with torch.no_grad():
59
+ outputs = model.generate(input_ids=inputs["input_ids"])
60
+ print(tokenizer.batch_decode(outputs.detach().cpu().numpy())[0])
61
+ ```
62
+
63
  ## Training and evaluation data
64
 
65
  More information needed