Update README.md
Browse files
README.md
CHANGED
@@ -42,13 +42,40 @@ It achieves the following results on the evaluation set:
|
|
42 |
|
43 |
## example
|
44 |
|
45 |
-
![prompt](https://i.imgur.com/DKHoLtB.png)
|
46 |
|
47 |
Results in (_DALL-E, but you get the idea_):
|
48 |
|
49 |
-
![
|
50 |
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
## Training and evaluation data
|
54 |
|
|
|
42 |
|
43 |
## example
|
44 |
|
|
|
45 |
|
46 |
Results in (_DALL-E, but you get the idea_):
|
47 |
|
48 |
+
![example](https://i.ibb.co/WkmTnZD/image.png)
|
49 |
|
50 |
+
|
51 |
+
|
52 |
+
- this `distilgpt2` version is probably small/fast enough to be used locally on CPU!
|
53 |
+
|
54 |
+
## basic usage
|
55 |
+
|
56 |
+
install transformers as needed:
|
57 |
+
|
58 |
+
```bash
|
59 |
+
pip install -U transformers
|
60 |
+
```
|
61 |
+
|
62 |
+
load and query through a `pipeline` object:
|
63 |
+
|
64 |
+
```python
|
65 |
+
from transformers import pipeline
|
66 |
+
|
67 |
+
model_tag = "pszemraj/distilgpt2-magicprompt-SD"
|
68 |
+
generator = pipeline(
|
69 |
+
"text-generation",
|
70 |
+
model=model_tag,
|
71 |
+
)
|
72 |
+
|
73 |
+
prompt = "The Answer to Why"
|
74 |
+
result = generator(
|
75 |
+
prompt,
|
76 |
+
) # generate
|
77 |
+
print(result[0]["generated_text"])
|
78 |
+
```
|
79 |
|
80 |
## Training and evaluation data
|
81 |
|