Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- Sentdex/wsb_reddit_v002
|
5 |
+
tags:
|
6 |
+
- not-for-all-audiences
|
7 |
+
---
|
8 |
+
|
9 |
+
# Model Card for WSB-GPT-7B
|
10 |
+
|
11 |
+
This is a Llama 2 7B Chat model fine-tuned with QLoRA on 2017-2018ish /r/wallstreetbets subreddit comments and responses, with the hopes of learning more about QLoRA and creating models with a little more character.
|
12 |
+
|
13 |
+
|
14 |
+
### Model Description
|
15 |
+
|
16 |
+
- **Developed by:** Sentdex
|
17 |
+
- **Shared by:** Sentdex
|
18 |
+
- **GPU Compute provided by:** [Lambda Labs](https://lambdalabs.com/service/gpu-cloud)
|
19 |
+
|
20 |
+
- **Model type:** Instruct/Chat
|
21 |
+
- **Language(s) (NLP):** Multilingual from Llama 2, but not sure what the fine-tune did to it, or if the fine-tuned behavior translates well to other languages. Let me know!
|
22 |
+
- **License:** Apache 2.0
|
23 |
+
- **Finetuned from Llama 2 7B Chat**
|
24 |
+
|
25 |
+
|
26 |
+
- **Demo [optional]:** [More Information Needed]
|
27 |
+
|
28 |
+
## Uses
|
29 |
+
|
30 |
+
This model's primary purpose is to be a fun chatbot and to learn more about QLoRA. It is not intended to be used for any other purpose and some people may find it abrasive/offensive.
|
31 |
+
|
32 |
+
## Bias, Risks, and Limitations
|
33 |
+
|
34 |
+
This model is prone to using at least 3 words that were popularly used in the WSB subreddit in that era that are much more frowned-upon. As time goes on, I may wind up pruning or find-replacing these words in the training data, or leaving it.
|
35 |
+
|
36 |
+
Just be advised this model can be offensive and is not intended for all audiences!
|
37 |
+
|
38 |
+
## How to Get Started with the Model
|
39 |
+
### Prompt Format:
|
40 |
+
|
41 |
+
```
|
42 |
+
### Comment:
|
43 |
+
[parent comment text]
|
44 |
+
|
45 |
+
### REPLY:
|
46 |
+
[bot's reply]
|
47 |
+
|
48 |
+
### END.
|
49 |
+
```
|
50 |
+
|
51 |
+
Use the code below to get started with the model.
|
52 |
+
|
53 |
+
```py
|
54 |
+
from transformers import pipeline
|
55 |
+
|
56 |
+
# Initialize the pipeline for text generation using the Sentdex/WSB-GPT-7B model
|
57 |
+
pipe = pipeline("text-generation", model="Sentdex/WSB-GPT-7B")
|
58 |
+
|
59 |
+
# Define your prompt
|
60 |
+
prompt = """### Comment:
|
61 |
+
How does the stock market actually work?
|
62 |
+
|
63 |
+
### REPLY:
|
64 |
+
"""
|
65 |
+
|
66 |
+
# Generate text based on the prompt
|
67 |
+
generated_text = pipe(prompt, max_length=128, num_return_sequences=1)
|
68 |
+
|
69 |
+
# Extract and print the generated text
|
70 |
+
print(generated_text[0]['generated_text'].split("### END.")[0])
|
71 |
+
```
|
72 |
+
|
73 |
+
Example continued generation from above:
|
74 |
+
|
75 |
+
```
|
76 |
+
### Comment:
|
77 |
+
How does the stock market actually work?
|
78 |
+
|
79 |
+
### REPLY:
|
80 |
+
You sell when you are up and buy when you are down.
|
81 |
+
```
|
82 |
+
|
83 |
+
Despite `</s>` being the typical Llama stop token, I was never able to get this token to be generated in training/testing so the model would just never stop generating. I wound up testing with ### END. and that worked, but obviously isn't ideal. Will fix this in the future maybe(tm).
|
84 |
+
|
85 |
+
#### Hardware
|
86 |
+
|
87 |
+
This QLoRA was trained on a Lambda Labs 1x H100 80GB GPU instance.
|
88 |
+
|
89 |
+
## Citation
|
90 |
+
|
91 |
+
Llama 2 (Meta AI) for the base model.
|
92 |
+
Farouk E / Far El: https://twitter.com/far__el for helping with all my silly questions about QLoRA
|
93 |
+
Lambda Labs for the compute. The model itself only took a few hours to train, but it took me days to learn how to tie everything together.
|
94 |
+
Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke Zettlemoyer for QLoRA + implementation on github: https://github.com/artidoro/qlora/
|
95 |
+
@eugene-yh and @jinyongyoo on Github + @ChrisHayduk for the QLoRA merge: https://gist.github.com/ChrisHayduk/1a53463331f52dca205e55982baf9930
|
96 |
+
|
97 |
+
|
98 |
+
## Model Card Contact
|
99 |
+
|
100 |