Text Generation
Transformers
Safetensors
English
gpt2
dialogpt
question-answering
fine-tuned
conversational
text-generation-inference
Instructions to use athospy/dialogpt-small-psu-programs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use athospy/dialogpt-small-psu-programs with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="athospy/dialogpt-small-psu-programs") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("athospy/dialogpt-small-psu-programs") model = AutoModelForCausalLM.from_pretrained("athospy/dialogpt-small-psu-programs", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use athospy/dialogpt-small-psu-programs with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "athospy/dialogpt-small-psu-programs" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "athospy/dialogpt-small-psu-programs", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/athospy/dialogpt-small-psu-programs
- SGLang
How to use athospy/dialogpt-small-psu-programs 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 "athospy/dialogpt-small-psu-programs" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "athospy/dialogpt-small-psu-programs", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "athospy/dialogpt-small-psu-programs" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "athospy/dialogpt-small-psu-programs", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use athospy/dialogpt-small-psu-programs with Docker Model Runner:
docker model run hf.co/athospy/dialogpt-small-psu-programs
|
Download README.md from athospy/dialogpt-small-psu-programs: direct link, hf CLI and curl.
- Browser
- Download file 4.39 kB
-
https://huggingface.co/athospy/dialogpt-small-psu-programs/resolve/main/README.md
- Command line
-
hf download hf://athospy/dialogpt-small-psu-programs/README.md
-
curl -L -o README.md https://huggingface.co/athospy/dialogpt-small-psu-programs/resolve/main/README.md
4.39 kB
| license: mit | |
| base_model: microsoft/DialoGPT-small | |
| language: | |
| - en | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - gpt2 | |
| - dialogpt | |
| - question-answering | |
| - fine-tuned | |
| # DialoGPT-small fine-tuned on Pittsburg State University program Q&A | |
| [microsoft/DialoGPT-small](https://huggingface.co/microsoft/DialoGPT-small) (124M parameters) fine-tuned on | |
| 100 question/answer pairs about Pittsburg State University (PSU) academic programs and general topics. A | |
| learning project, built to compare a small fine-tuned generator with retrieval on the same questions. | |
| - **Code, data and eval:** https://github.com/athospy/transformer_chatbot | |
| - **Live demo:** https://chatbot.santiagomorel.dev/. The demo answers by retrieval over sentence embeddings and | |
| shows this model's answer on demand next to it, because of the invented links described below. | |
| ## Use | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| repo = "athospy/dialogpt-small-psu-programs" | |
| tokenizer = AutoTokenizer.from_pretrained(repo) | |
| model = AutoModelForCausalLM.from_pretrained(repo) | |
| prompt = tokenizer("Tell me about the Art program at Pittsburg State University." + tokenizer.eos_token, | |
| return_tensors="pt") | |
| output = model.generate(**prompt, max_new_tokens=72, num_beams=3, early_stopping=True, | |
| no_repeat_ngram_size=3, repetition_penalty=1.2, | |
| pad_token_id=tokenizer.eos_token_id) | |
| print(tokenizer.decode(output[0, prompt["input_ids"].shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| The input format is `question<eos>`. The model writes the answer and ends it with `<eos>`. The settings above | |
| are the ones the demo and the eval use. | |
| **Check every link it writes.** Even on a question from its own training data it can mix up the URL path: | |
| > **Q:** Tell me about the Ceramics program at Pittsburg State University. | |
| > **A:** The Ceramic program offers various emphases. More details can be found here: | |
| > https://www.pittstate.edu/science/programs/ceramics/index.html | |
| > | |
| > The real page is under `/art/programs/ceramics/`. | |
| ## Training | |
| - **Data:** 172 Q&A pairs written in 2024 from PSU's public program pages (100 after removing exact repeats): | |
| 56 programs (only A to C, Accelerated Pre-Med through Construction Technology), each answer ending with the | |
| program's official link, plus 26 general questions. Each question was also added with "PSU" and | |
| "Pitt State" in place of the full name. | |
| - **Format:** one sequence per example, `question<eos>answer<eos>`, with the loss on the answer tokens only | |
| (the question positions get the label -100). | |
| - **Setup:** plain PyTorch loop, AdamW (lr 5e-5, weight decay 0.01), batch size 8, linear warmup over the first | |
| 10% of steps, gradient clipping 1.0, seed 42. 10% of the distinct pairs held out for validation. | |
| - **Result:** 268 training and 10 validation examples. Early stopping kept epoch 4 of 7, with validation loss | |
| 0.6259. 97 minutes on an Apple Silicon GPU (MPS). `training_summary.json` has the loss for each epoch. | |
| ## Evaluation | |
| 117 questions that aren't in the training data (paraphrases, typos, reworded general questions, programs the | |
| data doesn't cover, off-topic questions), split into 41 dev and 76 test. On the test split: | |
| | Model | Exact official link* | Names the program* | Token F1 vs. reference | Invented links | Says "I don't know" | | |
| |---|---|---|---|---|---| | |
| | **This model (2026)** | 45.5% | 47.7% | 0.674 | 56.6% | 0% | | |
| | Earlier 2024 version (training-format bug) | 0% | 18.2% | 0.074 | 0% | 0% | | |
| \* On program questions. | |
| For comparison, retrieval over all-MiniLM-L6-v2 embeddings answered 82% of the same test questions right, | |
| with no invented links. The repo's `eval/RESULTS.md` has every number. | |
| ## Limitations | |
| - **It invents links and programs.** Asked about a program the data doesn't cover (law, dentistry), it writes a | |
| confident answer with a plausible but nonexistent `pittstate.edu` link. Of the questions about programs | |
| outside the data, 8 of 9 got an invented link. It never says "I don't know". | |
| - The data covers only 56 programs (A to C) and was written in 2024, so details may be out of date. Check | |
| pittstate.edu. | |
| - Not for real advising or admissions decisions. | |
| ## License | |
| MIT, like the code. The base model, microsoft/DialoGPT-small, is MIT licensed. The Q&A text was written from | |
| pittstate.edu's public program pages. | |