zelalt commited on
Commit
c0d25a5
1 Parent(s): 49f1e34

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -7
README.md CHANGED
@@ -8,9 +8,6 @@ model-index:
8
  results: []
9
  ---
10
 
11
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
12
- should probably proofread and complete it, then remove this comment. -->
13
-
14
  # titletor-phi_1-5
15
 
16
  This model is a fine-tuned version of [microsoft/phi-1_5](https://huggingface.co/microsoft/phi-1_5) on an unknown dataset.
@@ -19,15 +16,24 @@ It achieves the following results on the evaluation set:
19
 
20
  ## Model description
21
 
22
- More information needed
23
 
24
- ## Intended uses & limitations
 
 
25
 
26
- More information needed
 
 
 
 
 
 
27
 
28
  ## Training and evaluation data
 
 
29
 
30
- More information needed
31
 
32
  ## Training procedure
33
 
 
8
  results: []
9
  ---
10
 
 
 
 
11
  # titletor-phi_1-5
12
 
13
  This model is a fine-tuned version of [microsoft/phi-1_5](https://huggingface.co/microsoft/phi-1_5) on an unknown dataset.
 
16
 
17
  ## Model description
18
 
19
+ ### Sample Code
20
 
21
+ ```python
22
+ import torch
23
+ from transformers import AutoModelForCausalLM, AutoTokenizer
24
 
25
+ model = AutoModelForCausalLM.from_pretrained("zelalt/titletor-phi_1-5", trust_remote_code=True)
26
+ tokenizer = AutoTokenizer.from_pretrained("zelalt/titletor-phi_1-5", trust_remote_code=True)
27
+ inputs = tokenizer(f'''What is the title of this paper? ....[your pdf as text]\n\nAnswer: ''', return_tensors="pt", return_attention_mask=False)
28
+ outputs = model.generate(**inputs,max_new_tokens=50, pad_token_id = tokenizer.eos_token_id, eos_token_id = tokenizer.eos_token_id)
29
+ text = tokenizer.batch_decode(outputs)[0]
30
+ print(text)
31
+ ```
32
 
33
  ## Training and evaluation data
34
+ Train and validation dataset:
35
+ [zelalt/scientific-papers-3.5-withprompt](https://huggingface.co/datasets/zelalt/scientific-papers-3.5-withprompt)
36
 
 
37
 
38
  ## Training procedure
39