Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
|
@@ -17,11 +20,11 @@ tags: []
|
|
| 17 |
|
| 18 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
|
| 20 |
-
- **Developed by:** [
|
| 21 |
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [
|
| 24 |
-
- **Language(s) (NLP):** [
|
| 25 |
- **License:** [More Information Needed]
|
| 26 |
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
|
@@ -33,13 +36,35 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
| 33 |
- **Paper [optional]:** [More Information Needed]
|
| 34 |
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
## Uses
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
### Direct Use
|
| 41 |
|
| 42 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
[More Information Needed]
|
| 45 |
|
|
@@ -196,6 +221,4 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
| 196 |
|
| 197 |
## Model Card Contact
|
| 198 |
|
| 199 |
-
[More Information Needed]
|
| 200 |
-
|
| 201 |
-
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
license: mit
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
---
|
| 8 |
|
| 9 |
# Model Card for Model ID
|
|
|
|
| 20 |
|
| 21 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 22 |
|
| 23 |
+
- **Developed by:** [Md Rashad Al Hasan Rony]
|
| 24 |
- **Funded by [optional]:** [More Information Needed]
|
| 25 |
- **Shared by [optional]:** [More Information Needed]
|
| 26 |
+
- **Model type:** [GPT-2]
|
| 27 |
+
- **Language(s) (NLP):** [English]
|
| 28 |
- **License:** [More Information Needed]
|
| 29 |
- **Finetuned from model [optional]:** [More Information Needed]
|
| 30 |
|
|
|
|
| 36 |
- **Paper [optional]:** [More Information Needed]
|
| 37 |
- **Demo [optional]:** [More Information Needed]
|
| 38 |
|
|
|
|
| 39 |
|
| 40 |
+
### Uses
|
|
|
|
|
|
|
| 41 |
|
| 42 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 43 |
+
```python
|
| 44 |
+
import transformers
|
| 45 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 46 |
+
model_name = "rony/gpt2-quantized-jokes"
|
| 47 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 48 |
+
prompt = tokenizer.apply_chat_template('JOKE: ', add_generation_prompt=True, tokenize=False)
|
| 49 |
+
|
| 50 |
+
# Create pipeline
|
| 51 |
+
pipeline = transformers.pipeline(
|
| 52 |
+
"text-generation",
|
| 53 |
+
model=model_name,
|
| 54 |
+
tokenizer=tokenizer
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
# Generate text
|
| 58 |
+
sequences = pipeline(
|
| 59 |
+
prompt,
|
| 60 |
+
do_sample=True,
|
| 61 |
+
temperature=0.7,
|
| 62 |
+
top_p=0.9,
|
| 63 |
+
num_return_sequences=1,
|
| 64 |
+
max_length=200,
|
| 65 |
+
)
|
| 66 |
+
print(sequences[0]['generated_text'])
|
| 67 |
+
```
|
| 68 |
|
| 69 |
[More Information Needed]
|
| 70 |
|
|
|
|
| 221 |
|
| 222 |
## Model Card Contact
|
| 223 |
|
| 224 |
+
[More Information Needed]
|
|
|
|
|
|