Downloads · 30 days
13
2% of all-time downloads
Andyrasika/finetuned-gpt2_dolly_lite
finetuned-gpt2_dolly_lite is a text generation model from Andyrasika. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
13
2% of all-time downloads
All-time downloads
663
Public
Repo size
3.3 GB
Likes
1
Public
Click a slice to open those files.
.pt2 GB · 60%
From the Hugging Face model README
This model is a fine-tuned version of distilgpt2 on an unknown dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 2.708 | 1.0 | 1300 | 2.5611 |
| 2.1768 | 2.0 | 2600 | 2.4149 |
| 1.7189 | 3.0 | 3900 | 2.4067 |
MODEL = 'distilgpt2'
tokenizer = AutoTokenizer.from_pretrained(MODEL)
tokenizer.pad_token = tokenizer.eos_token
def respond(instruction, generator, _input=None, verbose=False, **options):
if not _input:
prompt = f'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Response:\n'
else:
prompt = f'Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\n{instruction}\n\n### Input: {_input}\n\n### Response:\n'
if verbose:
print(prompt)
generated_texts = generator(
prompt,
num_return_sequences=3,
temperature=options.get('temperature', 0.7),
max_new_tokens=options.get('max_new_tokens', 128)
)
for generated_text in generated_texts:
print(generated_text['generated_text'].split('### Response:\n')[1])
print('----')
loaded_model = AutoModelForCausalLM.from_pretrained('Andyrasika/gpt2_dolly_lite')
dolly_lite = pipeline('text-generation', model=loaded_model, tokenizer=tokenizer)
respond(
'Write me an email to my boss, telling her I quit because I made a cool LLM.', dolly_lite
)