Instructions to use danyaljj/gpt2_question_generation_given_paragraph_answer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use danyaljj/gpt2_question_generation_given_paragraph_answer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="danyaljj/gpt2_question_generation_given_paragraph_answer")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("danyaljj/gpt2_question_generation_given_paragraph_answer") model = AutoModelForCausalLM.from_pretrained("danyaljj/gpt2_question_generation_given_paragraph_answer") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use danyaljj/gpt2_question_generation_given_paragraph_answer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "danyaljj/gpt2_question_generation_given_paragraph_answer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "danyaljj/gpt2_question_generation_given_paragraph_answer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/danyaljj/gpt2_question_generation_given_paragraph_answer
- SGLang
How to use danyaljj/gpt2_question_generation_given_paragraph_answer 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 "danyaljj/gpt2_question_generation_given_paragraph_answer" \ --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": "danyaljj/gpt2_question_generation_given_paragraph_answer", "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 "danyaljj/gpt2_question_generation_given_paragraph_answer" \ --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": "danyaljj/gpt2_question_generation_given_paragraph_answer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use danyaljj/gpt2_question_generation_given_paragraph_answer with Docker Model Runner:
docker model run hf.co/danyaljj/gpt2_question_generation_given_paragraph_answer
update
Browse files- config.json +37 -0
- last_eval_metrics.json +1 -0
- merges.txt +0 -0
- metrics.json +1 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.json +0 -0
config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT2LMHeadModel"
|
| 5 |
+
],
|
| 6 |
+
"attn_pdrop": 0.1,
|
| 7 |
+
"bos_token_id": 50256,
|
| 8 |
+
"embd_pdrop": 0.1,
|
| 9 |
+
"eos_token_id": 50256,
|
| 10 |
+
"finetuning_task": null,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"layer_norm_epsilon": 1e-05,
|
| 13 |
+
"model_type": "gpt2",
|
| 14 |
+
"n_ctx": 1024,
|
| 15 |
+
"n_embd": 768,
|
| 16 |
+
"n_head": 12,
|
| 17 |
+
"n_layer": 12,
|
| 18 |
+
"n_positions": 1024,
|
| 19 |
+
"num_labels": 1,
|
| 20 |
+
"output_attentions": false,
|
| 21 |
+
"output_hidden_states": false,
|
| 22 |
+
"pruned_heads": {},
|
| 23 |
+
"resid_pdrop": 0.1,
|
| 24 |
+
"summary_activation": null,
|
| 25 |
+
"summary_first_dropout": 0.1,
|
| 26 |
+
"summary_proj_to_labels": true,
|
| 27 |
+
"summary_type": "cls_index",
|
| 28 |
+
"summary_use_proj": true,
|
| 29 |
+
"task_specific_params": {
|
| 30 |
+
"text-generation": {
|
| 31 |
+
"do_sample": true,
|
| 32 |
+
"max_length": 50
|
| 33 |
+
}
|
| 34 |
+
},
|
| 35 |
+
"torchscript": false,
|
| 36 |
+
"vocab_size": 50257
|
| 37 |
+
}
|
last_eval_metrics.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
perplexity = 5.620667457580566
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
metrics.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"2000.perplexity": 5.736455917358398, "4000.perplexity": 5.489027976989746, "6000.perplexity": 5.511296272277832, "8000.perplexity": 5.422763347625732, "10000.perplexity": 5.544301986694336, "12000.perplexity": 5.620221138000488, "best_perp": 5.422763347625732, "best_perp_step": 8000}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c2b1d889fe27c78f769cd88e3abb694aff62df986c5bf5b57399f74ad8d8521
|
| 3 |
+
size 548125486
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"do_lower_case": false, "max_len": 1024, "init_inputs": []}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9efc39d5ec8468fd748395dd37847ed0e55645ef43ba7719d86242f746b56334
|
| 3 |
+
size 1264
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|