dexxiez/quora-titles
Updated • 3
How to use dexxiez/quora-title-gen with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="dexxiez/quora-title-gen") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("dexxiez/quora-title-gen")
model = AutoModelForCausalLM.from_pretrained("dexxiez/quora-title-gen")How to use dexxiez/quora-title-gen with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "dexxiez/quora-title-gen"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "dexxiez/quora-title-gen",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/dexxiez/quora-title-gen
How to use dexxiez/quora-title-gen with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "dexxiez/quora-title-gen" \
--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": "dexxiez/quora-title-gen",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "dexxiez/quora-title-gen" \
--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": "dexxiez/quora-title-gen",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use dexxiez/quora-title-gen with Docker Model Runner:
docker model run hf.co/dexxiez/quora-title-gen
A fine-tuned GPT-2 model specialized for generating Quora-style question titles. This model has been trained on a curated dataset of Quora question titles to learn the patterns and style of effective question formulation.
This model is a fine-tuned version of GPT-2 specifically designed to generate compelling and realistic Quora question titles. It can be used for:
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model_name = "dexxiez/quora-title-gen"
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
model = GPT2LMHeadModel.from_pretrained(model_name)
# Generate a random title
input_text = "<|startoftext|>"
inputs = tokenizer.encode(input_text, return_tensors="pt")
outputs = model.generate(
inputs,
max_length=50,
temperature=0.8,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
title = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(title)
# Complete a partial question
prompt = "<|startoftext|>How to learn"
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(
inputs,
max_length=100,
temperature=0.8,
top_p=0.95,
top_k=50,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
completed_title = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(completed_title)
<|startoftext|>title<|endoftext|>)<|startoftext|>, <|endoftext|>, <|pad|>| Parameter | Recommended | Description |
|---|---|---|
temperature |
0.8-1.2 | Controls creativity (lower = more focused) |
top_p |
0.95 | Nucleus sampling threshold |
top_k |
50 | Top-k sampling limit |
max_length |
50-100 | Maximum tokens to generate |
Random Generation:
Text Completion:
Input: "How to learn"
Output: "How to learn data science without a computer science background?"
Input: "What is the best way"
Output: "What is the best way to prepare for coding interviews at FAANG companies?"
This model was trained on the dexxiez/quora-titles dataset, which contains:
@misc{quora-title-gen,
title={Quora Title Generator: Fine-tuned GPT-2 for Question Generation},
author={dexxiez},
year={2025},
url={https://huggingface.co/dexxiez/quora-title-gen}
}
MIT License
Base model
openai-community/gpt2