Instructions to use singtan/my-llm-finetuned-pdf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use singtan/my-llm-finetuned-pdf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="singtan/my-llm-finetuned-pdf")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("singtan/my-llm-finetuned-pdf") model = AutoModelForCausalLM.from_pretrained("singtan/my-llm-finetuned-pdf") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use singtan/my-llm-finetuned-pdf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "singtan/my-llm-finetuned-pdf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "singtan/my-llm-finetuned-pdf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/singtan/my-llm-finetuned-pdf
- SGLang
How to use singtan/my-llm-finetuned-pdf 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 "singtan/my-llm-finetuned-pdf" \ --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": "singtan/my-llm-finetuned-pdf", "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 "singtan/my-llm-finetuned-pdf" \ --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": "singtan/my-llm-finetuned-pdf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use singtan/my-llm-finetuned-pdf with Docker Model Runner:
docker model run hf.co/singtan/my-llm-finetuned-pdf
Fine-tuned Language Model (PDF Optimized)
This model is a specialized version of gpt2, fine-tuned for high-context coherence based on technical documentation extracted from PDF sources.
Model Summary
This model was developed to improve text generation accuracy and contextual understanding for specific domains covered in the provided PDF assets. It leverages the underlying architecture of gpt2 and is optimized for the structure and vocabulary found in document-based datasets.
Key Specifications
| Attribute | Value |
|---|---|
| Base Architecture | gpt2 |
| Format | PyTorch (Transformers) |
| Task | Causal Language Modeling |
| Language | English (en) |
Training Configuration
The model was fine-tuned using the following high-level hyperparameters to ensure stability and convergence:
- Epochs: 3
- Batch Size: 1
- Learning Rate: 5e-05
- Optimized for: Cross-Entropy Loss
- Hardware: cuda
Performance Metrics
- Total Training Loss: 3.680997848510742
- Training Runtime: 3.6704 seconds
Data Preprocessing
The training data was sourced from dummy.pdf. The pipeline included:
- Extraction: Text recovery using
pypdf. - Normalization: Regex-based whitespace cleaning and token normalization.
- Tokenization: Model-specific subword tokenization with a max sequence length of 512 tokens.
Usage Instructions
To utilize this model for inference, use the following snippet:
from transformers import AutoTokenizer, AutoModelForCausalLM
checkpoint = "singtan/my-llm-finetuned-pdf"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint)
prompt = "Insert your context here"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=150)
print(tokenizer.decode(outputs[0]))
Contact
Developed by Bibek - Senior AI Engineering Portfolio.
- Downloads last month
- 422
Model tree for singtan/my-llm-finetuned-pdf
Base model
openai-community/gpt2