Downloads · 30 days
7
28% of all-time downloads
Tasfiya025/NanoGPT-Abstract-Generator
NanoGPT-Abstract-Generator is a machine learning model from Tasfiya025. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
NanoGPT-Abstract-Generator is a smaller, more efficient version of the GPT-2 architecture fine-tuned for generating concise, high-quality abstracts from a provided input sentence or a short document prompt. It is desi…
Downloads · 30 days
7
28% of all-time downloads
All-time downloads
25
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md3.1 KB · 50%
From the Hugging Face model README
NanoGPT-Abstract-Generator is a smaller, more efficient version of the GPT-2 architecture fine-tuned for generating concise, high-quality abstracts from a provided input sentence or a short document prompt. It is designed for low-latency inference on general-purpose text generation tasks.
This model is a strong choice for applications requiring quick, coherent, and contextually relevant text snippets without the massive computational overhead of larger models like GPT-3 or full-sized GPT-2 variants.
The model is based on the GPT-2 decoder-only architecture, but significantly scaled down for efficiency (hence 'NanoGPT').
GPT2LMHeadModel)n_ctx): 512 tokens.from transformers import pipeline
model_name = "NLP/NanoGPT-Abstract-Generator"
# The 'text-generation' pipeline handles the model and tokenizer automatically
generator = pipeline("text-generation", model=model_name)
prompt = "The recent advancements in quantum computing have shifted the paradigm"
# Generate text with specific decoding parameters
output = generator(
prompt,
max_length=50,
num_return_sequences=1,
temperature=0.7, # Controls randomness
top_k=50, # Sampling top K tokens
do_sample=True, # Enable sampling
pad_token_id=generator.tokenizer.eos_token_id # Set padding to EOS token
)
print(f"Prompt: {prompt}\n--- Abstract ---\n{output[0]['generated_text']}")
# Example Output:
# "The recent advancements in quantum computing have shifted the paradigm of theoretical cryptography, making several historically secure algorithms vulnerable to polynomial-time attacks. Researchers are now prioritizing the development of post-quantum cryptography protocols."