Instructions to use Tasfiya025/AcademicAbstractGenerator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tasfiya025/AcademicAbstractGenerator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tasfiya025/AcademicAbstractGenerator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Tasfiya025/AcademicAbstractGenerator") model = AutoModelForCausalLM.from_pretrained("Tasfiya025/AcademicAbstractGenerator") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Tasfiya025/AcademicAbstractGenerator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tasfiya025/AcademicAbstractGenerator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tasfiya025/AcademicAbstractGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Tasfiya025/AcademicAbstractGenerator
- SGLang
How to use Tasfiya025/AcademicAbstractGenerator with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Tasfiya025/AcademicAbstractGenerator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tasfiya025/AcademicAbstractGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Tasfiya025/AcademicAbstractGenerator" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Tasfiya025/AcademicAbstractGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Tasfiya025/AcademicAbstractGenerator with Docker Model Runner:
docker model run hf.co/Tasfiya025/AcademicAbstractGenerator
AcademicAbstractGenerator: DistilGPT2 Fine-tuned for Scientific Text
π Overview
This model is a fine-tuned version of DistilGPT2, optimized for the task of generating short, high-quality, and structurally consistent academic abstract drafts. It has been trained exclusively on a corpus of abstracts from arXiv, focusing on fields like Computer Science and Physics.
π€ Model Architecture
The model utilizes the GPT-2 decoder-only transformer architecture, offering efficiency and speed due to the Distil model's reduced size.
- Base Model:
distilgpt2(a distilled, smaller version of GPT-2). - Architecture: Decoder-only transformer stack.
- Layers: 6 transformer layers.
- Task: Causal Language Modeling (Text Generation).
- Training Objective: Minimizing the perplexity on academic text, enabling it to better capture formal structure, complex vocabulary, and typical flow of scientific summaries (Introduction -> Method -> Result -> Conclusion).
π― Intended Use
This model is intended for:
- Drafting: Assisting researchers in generating initial abstract drafts for new papers.
- Ideation: Exploring potential research directions by prompting the model with a topic sentence.
- Educational Purposes: Learning about generative model capabilities in a specialized domain.
β οΈ Limitations
- Factuality: The model is a text generator, not a knowledge base. Generated content may contain plausible-sounding but factually incorrect claims or results. Human review is mandatory.
- Length: Due to its base architecture and training data, it performs best on short sequences (under 256 tokens).
- Overfitting: May occasionally repeat boilerplate phrases common in academic writing.
π» Example Code
Use the TextGenerationPipeline for drafting abstracts:
from transformers import pipeline, set_seed
set_seed(42)
# Load the model and tokenizer
generator = pipeline('text-generation', model='[YOUR_HF_USERNAME]/AcademicAbstractGenerator')
prompt = "We propose a novel attention mechanism for transformer models that significantly improves training efficiency."
# Generate a 150-token abstract draft
output = generator(
prompt,
max_length=150,
num_return_sequences=1,
temperature=0.7,
do_sample=True,
truncation=True
)
print(output[0]['generated_text'])
- Downloads last month
- 2