Downloads · 30 days
162
0% of all-time downloads
Locutusque/gpt2-conversational-retrain
gpt2-conversational-retrain is a text generation model from Locutusque. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This a fine-tuned version of gpt2 on Locutusque/InstructMix.
Downloads · 30 days
162
0% of all-time downloads
All-time downloads
32.7K
Public
Parameters
124M
747 MB on disk
Likes
2
Public
Click a slice to open those files.
.bin249 MB · 50%
From the Hugging Face model README
This a fine-tuned version of gpt2 on Locutusque/InstructMix.
This model performs significantly better than Locutusque/gpt2-conversational-or-qa. Here are the training results:
This model is designed to follow instructions, or partake in conversations.
Instruction-following or conversational.
[More Information Needed]
[More Information Needed]
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-conversational-retrain')
model = GPT2LMHeadModel.from_pretrained('gpt2-conversational-retrain')
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
def generate_text(model, tokenizer, prompt, max_length=1024):
prompt = f'<|USER|> {prompt} <|ASSISTANT|> '
input_ids = tokenizer.encode(prompt, add_special_tokens=True, return_tensors="pt").to(device)
attention_mask = torch.ones_like(input_ids).to(device)
output = model.generate(input_ids,
max_length=max_length,
do_sample=True,
temperature=0.3,
top_k=23,
top_p=0.7,
repetition_penalty=1.176,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
attention_mask=attention_mask)
output_ids = tokenizer.decode(output[0], skip_special_tokens=False)
return output_ids
# Loop to interact with the model
while True:
prompt = input("Enter a prompt (or 'q' to quit): ")
if prompt == "q":
break
output_text = generate_text(model, tokenizer, prompt)
print(output_text)
https://huggingface.co/datasets/Locutusque/InstructMix
This model has so far been trained on 10% of the linked data, with more training sessions to come.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]