Downloads · 30 days
7
11% of all-time downloads
kr-manish/gpt2-autotrain-finetuned-vff
gpt2-autotrain-finetuned-vff is a text generation model from kr-manish. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
This model was trained using AutoTrain. For more information, please visit AutoTrain.
Downloads · 30 days
7
11% of all-time downloads
All-time downloads
64
Public
Parameters
124M
1.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt996 MB · 50%
From the Hugging Face model README
This model was trained using AutoTrain. For more information, please visit AutoTrain.
#dataset used for custom training is : timdettmers/openassistant-guanaco
from transformers import GPT2Tokenizer, GPT2LMHeadModel
# Load the fine-tuned model and tokenizer from the Hugging Face Model Hub
model_name = "kr-manish/gpt2-autotrain-finetuned-vff"
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
model = GPT2LMHeadModel.from_pretrained(model_name)
# Input text
input_text = "what is generative ai?"
# Tokenize input text
input_ids = tokenizer.encode(input_text, return_tensors="pt")
# Generate output text
output = model.generate(input_ids, max_length=100, num_return_sequences=1, do_sample=True)
# Decode and print output
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(generated_text)
#what is generative ai?### Assistant: Generative AI is a powerful, but simple approach to problem-solving that involves generating patterns and graphs involving inputs, outputs, and decisiones. It involves the use of the pre-trained model "intelligence algorithms" to analyze the input data to make predictions that can be influenced by future data usage and other constraints. As a general rule, generative models can be fine-tuned to specific
#to get response in othet language set "src_lang"
#example: src_lang="en"
from transformers import GPT2Tokenizer, GPT2LMHeadModel
# Load the fine-tuned model and tokenizer from the Hugging Face Model Hub
model_name = "kr-manish/gpt2-autotrain-finetuned-vff"
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
model = GPT2LMHeadModel.from_pretrained(model_name)
# Input text
input_text = "explain the difference between GAN and generative ai?"
# Tokenize input text
input_ids = tokenizer.encode(input_text, return_tensors="pt")
# Generate output text
output = model.generate(input_ids, max_length=100, num_return_sequences=1, do_sample=True)
# Decode and print output
generated_text = tokenizer.decode(output[0], skip_special_tokens=True, src_lang="en")
print(generated_text)
#explain the difference between GAN and generative ai?### Assistant: GAN is a deep learning model that uses neural networks to learn natural language and generate text. Generative ai works by training the model on a set of natural tasks, such as recognizing faces or playing games, to generate a complete model of language. GAN trains on two inputs: a set of tokens for words and input images into a GAN tree, which represents the learning process. GAN then trains on