Update README.md
Browse files
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 |
-
|
23 |
|
24 |
-
|
|
|
|
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|