|
--- |
|
license: apache-2.0 |
|
datasets: |
|
- Sentdex/WSB-003.004 |
|
pipeline_tag: text-generation |
|
--- |
|
|
|
Probably don't use this model, I'm just tinkering, but it's a multi-turn, multi-speaker model attempt trained from /r/wallstreetbets data that you can find: https://huggingface.co/datasets/Sentdex/WSB-003.004 |
|
|
|
```py |
|
#https://huggingface.co/docs/peft/quicktour |
|
|
|
from peft import AutoPeftModelForCausalLM |
|
from transformers import AutoTokenizer |
|
import torch |
|
|
|
model = AutoPeftModelForCausalLM.from_pretrained("Sentdex/Walls1337bot-Llama2-7B-003.004.400") |
|
tokenizer = AutoTokenizer.from_pretrained("NousResearch/Llama-2-7b-chat-hf") |
|
|
|
model = model.to("cuda") |
|
model.eval() |
|
|
|
prompt = "Your text here." |
|
formatted_prompt = f"### BEGIN CONVERSATION ###\n\n## Speaker_0: ##\n{prompt}\n\n## Walls1337bot: ##\n" |
|
inputs = tokenizer(formatted_prompt, return_tensors="pt") |
|
outputs = model.generate(input_ids=inputs["input_ids"].to("cuda"), max_new_tokens=128) |
|
print(tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0]) |
|
``` |