Text Generation
Transformers
PyTorch
Safetensors
English
gpt2
gpt
trivia
chatbot
text-generation-inference
Instructions to use pszemraj/Ballpark-Trivia-XL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pszemraj/Ballpark-Trivia-XL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pszemraj/Ballpark-Trivia-XL")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("pszemraj/Ballpark-Trivia-XL") model = AutoModelForMultimodalLM.from_pretrained("pszemraj/Ballpark-Trivia-XL") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pszemraj/Ballpark-Trivia-XL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pszemraj/Ballpark-Trivia-XL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pszemraj/Ballpark-Trivia-XL", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pszemraj/Ballpark-Trivia-XL
- SGLang
How to use pszemraj/Ballpark-Trivia-XL 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 "pszemraj/Ballpark-Trivia-XL" \ --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": "pszemraj/Ballpark-Trivia-XL", "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 "pszemraj/Ballpark-Trivia-XL" \ --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": "pszemraj/Ballpark-Trivia-XL", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pszemraj/Ballpark-Trivia-XL with Docker Model Runner:
docker model run hf.co/pszemraj/Ballpark-Trivia-XL
Commit ·
1e4fe23
verified ·
0
Parent(s):
Super-squash branch 'main' using huggingface_hub
Browse filesCo-authored-by: SFconvertbot <SFconvertbot@users.noreply.huggingface.co>
- .gitattributes +28 -0
- README.md +61 -0
- config.json +42 -0
- merges.txt +0 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- text-generation
|
| 7 |
+
- gpt2
|
| 8 |
+
- gpt
|
| 9 |
+
- trivia
|
| 10 |
+
- chatbot
|
| 11 |
+
license: mit
|
| 12 |
+
|
| 13 |
+
widget:
|
| 14 |
+
- text: "how many ping-pong balls fit inside a standard 747 jet aeroplane?\nperson beta:\n\n"
|
| 15 |
+
example_title: "ping-pong"
|
| 16 |
+
- text: "What is the capital of Uganda?\nperson beta:\n\n"
|
| 17 |
+
example_title: "geography"
|
| 18 |
+
- text: "What is the most popular TV show of all time?\nperson beta:\n\n"
|
| 19 |
+
example_title: "pseudo-culture"
|
| 20 |
+
- text: "A man pushes his car to a hotel and tells the owner he’s bankrupt. Why?\nperson beta:\n\n"
|
| 21 |
+
example_title: "brain teaser"
|
| 22 |
+
|
| 23 |
+
inference:
|
| 24 |
+
parameters:
|
| 25 |
+
min_length: 2
|
| 26 |
+
max_length: 32
|
| 27 |
+
no_repeat_ngram_size: 2
|
| 28 |
+
do_sample: False
|
| 29 |
+
num_beams: 4
|
| 30 |
+
early_stopping: True
|
| 31 |
+
repetition_penalty: 2.1
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
# Ballpark Trivia: Size XL
|
| 37 |
+
|
| 38 |
+
**Check out a demo on HF Spaces [here](https://huggingface.co/spaces/pszemraj/ballpark-trivia).**
|
| 39 |
+
|
| 40 |
+
Are you frequently asked google-able Trivia questions and annoyed by it? Well, this is the model for you! Ballpark Trivia Bot answers any trivia question with something that sounds plausible but is probably not 100% correct. One might say.. the answers are in the right ballpark.
|
| 41 |
+
|
| 42 |
+
This is by far the largest model trained and should be _more_ credible in its answers or at least able to handle more kinds of questions.
|
| 43 |
+
|
| 44 |
+
```
|
| 45 |
+
what is the temperature of dry ice in kelvin
|
| 46 |
+
|
| 47 |
+
person beta:
|
| 48 |
+
194.65 K
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Training
|
| 52 |
+
This text gen model is a GPT-2 ~1.5 B Parameter Size XL Model, first trained on [Wizard of Wikipedia](https://parl.ai/projects/wizard_of_wikipedia/) for 40k steps (**33**/36 layers frozen for the fine-tuning), and then subsequently trained for 40k steps on a parsed variant of [Natural Questions](https://ai.google.com/research/NaturalQuestions)(then **34**/36 layers frozen for the second fine-tuning) to accidentally create this model.
|
| 53 |
+
|
| 54 |
+
Note that because the model was originally trained for use in a [chatbot application](https://github.com/pszemraj/ai-msgbot), it uses a named conversation dialogue structure, _i.e. the questions are asked by person alpha, and responded to by person beta_. Even if you don't specify person alpha in the prompt, it hopefully responds to any question.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
## Example Prompt
|
| 58 |
+
|
| 59 |
+
- the default examples are not great
|
| 60 |
+
- you can type in any trivia question or delete the example and write `what` or `when` in there, and it will generate the rest of the trivia question **and the answer**!
|
| 61 |
+
|
config.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "C:\\Users\\peter\\source\\ai-msgbot\\GPT-Ballpark-Trivia-XL",
|
| 3 |
+
"activation_function": "gelu_new",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 50256,
|
| 9 |
+
"embd_pdrop": 0.1,
|
| 10 |
+
"eos_token_id": 50256,
|
| 11 |
+
"gradient_checkpointing": true,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"line_by_line": false,
|
| 15 |
+
"model_type": "gpt2",
|
| 16 |
+
"n_ctx": 1024,
|
| 17 |
+
"n_embd": 1600,
|
| 18 |
+
"n_head": 25,
|
| 19 |
+
"n_inner": null,
|
| 20 |
+
"n_layer": 48,
|
| 21 |
+
"n_positions": 1024,
|
| 22 |
+
"output_past": true,
|
| 23 |
+
"reorder_and_upcast_attn": false,
|
| 24 |
+
"resid_pdrop": 0.1,
|
| 25 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 26 |
+
"scale_attn_weights": true,
|
| 27 |
+
"summary_activation": null,
|
| 28 |
+
"summary_first_dropout": 0.1,
|
| 29 |
+
"summary_proj_to_labels": true,
|
| 30 |
+
"summary_type": "cls_index",
|
| 31 |
+
"summary_use_proj": true,
|
| 32 |
+
"task_specific_params": {
|
| 33 |
+
"text-generation": {
|
| 34 |
+
"do_sample": true,
|
| 35 |
+
"max_length": 50
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"torch_dtype": "float32",
|
| 39 |
+
"transformers_version": "4.12.5",
|
| 40 |
+
"use_cache": false,
|
| 41 |
+
"vocab_size": 50257
|
| 42 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b30071bac51231932ed4005d7416e74726493bc62f814cd3b5ab04cc2be4bd44
|
| 3 |
+
size 6280847624
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c693627be180138c71df694862239223be0ec56a49556cf37755dd9a2ccb232b
|
| 3 |
+
size 6281014989
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "pad_token": "<|endoftext|>", "additional_special_tokens": ["<|endoftext|>"]}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "bos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true, "__type": "AddedToken"}, "add_prefix_space": false, "pad_token": "<|endoftext|>", "verbose": false, "errors": "replace", "tokenizer_class": "GPT2Tokenizer"}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|