chiyuzhang
commited on
Commit
•
ddd6b0a
1
Parent(s):
477a2db
Update README.md
Browse files
README.md
CHANGED
@@ -5,6 +5,8 @@ tags:
|
|
5 |
model-index:
|
6 |
- name: flan-t5-small-distil-v2
|
7 |
results: []
|
|
|
|
|
8 |
---
|
9 |
|
10 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
@@ -41,7 +43,50 @@ The following hyperparameters were used during training:
|
|
41 |
- lr_scheduler_type: linear
|
42 |
- num_epochs: 5
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
|
@@ -50,4 +95,4 @@ The following hyperparameters were used during training:
|
|
50 |
- Transformers 4.27.0
|
51 |
- Pytorch 2.0.0+cu117
|
52 |
- Datasets 2.2.0
|
53 |
-
- Tokenizers 0.13.2
|
|
|
5 |
model-index:
|
6 |
- name: flan-t5-small-distil-v2
|
7 |
results: []
|
8 |
+
language:
|
9 |
+
- en
|
10 |
---
|
11 |
|
12 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
43 |
- lr_scheduler_type: linear
|
44 |
- num_epochs: 5
|
45 |
|
46 |
+
## Use
|
47 |
+
|
48 |
+
### CPU
|
49 |
+
|
50 |
+
<details>
|
51 |
+
<summary> Click to expand </summary>
|
52 |
+
|
53 |
+
```python
|
54 |
+
# pip install -q transformers
|
55 |
+
from transformers import pipeline
|
56 |
+
|
57 |
+
checkpoint = "{model_name}"
|
58 |
+
|
59 |
+
model = pipeline('text2text-generation', model=checkpoint, use_auth_token=True)
|
60 |
+
|
61 |
+
input_prompt = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
62 |
+
generated_text = generator(input_prompt, max_length=512, do_sample=True, repetition_penalty=1.5)[0]['generated_text']
|
63 |
+
|
64 |
+
print("Response": generated_text)
|
65 |
+
```
|
66 |
+
|
67 |
+
</details>
|
68 |
+
|
69 |
+
### GPU
|
70 |
+
|
71 |
+
<details>
|
72 |
+
<summary> Click to expand </summary>
|
73 |
+
|
74 |
+
```python
|
75 |
+
# pip install -q transformers
|
76 |
+
from transformers import pipeline
|
77 |
+
|
78 |
+
checkpoint = "{model_name}"
|
79 |
+
|
80 |
+
model = pipeline('text2text-generation', model=checkpoint, use_auth_token=True, device=0)
|
81 |
+
|
82 |
+
input_prompt = 'Please let me know your thoughts on the given place and why you think it deserves to be visited: \n"Barcelona, Spain"'
|
83 |
+
generated_text = generator(input_prompt, max_length=512, do_sample=True, repetition_penalty=1.5)[0]['generated_text']
|
84 |
+
|
85 |
+
print("Response": generated_text)
|
86 |
+
```
|
87 |
+
|
88 |
+
</details>
|
89 |
+
|
90 |
|
91 |
|
92 |
|
|
|
95 |
- Transformers 4.27.0
|
96 |
- Pytorch 2.0.0+cu117
|
97 |
- Datasets 2.2.0
|
98 |
+
- Tokenizers 0.13.2
|