Text Generation
Transformers
Safetensors
English
code
plbart
text2text-generation
code-summarization
docstring-generation
python
Eval Results (legacy)
Instructions to use thealper2/plbart-docstring-generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thealper2/plbart-docstring-generation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="thealper2/plbart-docstring-generation")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("thealper2/plbart-docstring-generation") model = AutoModelForSeq2SeqLM.from_pretrained("thealper2/plbart-docstring-generation", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thealper2/plbart-docstring-generation with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thealper2/plbart-docstring-generation" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thealper2/plbart-docstring-generation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/thealper2/plbart-docstring-generation
- SGLang
How to use thealper2/plbart-docstring-generation 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 "thealper2/plbart-docstring-generation" \ --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": "thealper2/plbart-docstring-generation", "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 "thealper2/plbart-docstring-generation" \ --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": "thealper2/plbart-docstring-generation", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use thealper2/plbart-docstring-generation with Docker Model Runner:
docker model run hf.co/thealper2/plbart-docstring-generation
Upload folder using huggingface_hub
Browse files- config.json +35 -0
- generation_config.json +39 -0
- model.safetensors +3 -0
- sentencepiece.bpe.model +3 -0
- tokenizer_config.json +25 -0
- training_args.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"activation_function": "gelu",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"PLBartForConditionalGeneration"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"bos_token_id": 0,
|
| 9 |
+
"classifier_dropout": 0.0,
|
| 10 |
+
"d_model": 768,
|
| 11 |
+
"decoder_attention_heads": 12,
|
| 12 |
+
"decoder_ffn_dim": 3072,
|
| 13 |
+
"decoder_layerdrop": 0.0,
|
| 14 |
+
"decoder_layers": 6,
|
| 15 |
+
"decoder_start_token_id": 50003,
|
| 16 |
+
"dropout": 0.1,
|
| 17 |
+
"dtype": "float32",
|
| 18 |
+
"encoder_attention_heads": 12,
|
| 19 |
+
"encoder_ffn_dim": 3072,
|
| 20 |
+
"encoder_layerdrop": 0.0,
|
| 21 |
+
"encoder_layers": 6,
|
| 22 |
+
"eos_token_id": 2,
|
| 23 |
+
"forced_eos_token_id": 2,
|
| 24 |
+
"init_std": 0.02,
|
| 25 |
+
"is_decoder": false,
|
| 26 |
+
"is_encoder_decoder": true,
|
| 27 |
+
"max_position_embeddings": 1024,
|
| 28 |
+
"model_type": "plbart",
|
| 29 |
+
"pad_token_id": 1,
|
| 30 |
+
"scale_embedding": true,
|
| 31 |
+
"tie_word_embeddings": true,
|
| 32 |
+
"transformers_version": "5.17.0",
|
| 33 |
+
"use_cache": false,
|
| 34 |
+
"vocab_size": 50005
|
| 35 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": false,
|
| 3 |
+
"assistant_confidence_threshold": 0.4,
|
| 4 |
+
"assistant_lookbehind": 10,
|
| 5 |
+
"bos_token_id": 0,
|
| 6 |
+
"decoder_start_token_id": 50003,
|
| 7 |
+
"diversity_penalty": 0.0,
|
| 8 |
+
"do_sample": false,
|
| 9 |
+
"early_stopping": true,
|
| 10 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 11 |
+
"encoder_repetition_penalty": 1.0,
|
| 12 |
+
"eos_token_id": [
|
| 13 |
+
2
|
| 14 |
+
],
|
| 15 |
+
"epsilon_cutoff": 0.0,
|
| 16 |
+
"eta_cutoff": 0.0,
|
| 17 |
+
"forced_eos_token_id": 2,
|
| 18 |
+
"length_penalty": 1.0,
|
| 19 |
+
"max_length": 64,
|
| 20 |
+
"min_length": 0,
|
| 21 |
+
"no_repeat_ngram_size": 0,
|
| 22 |
+
"num_assistant_tokens": 20,
|
| 23 |
+
"num_assistant_tokens_schedule": "constant",
|
| 24 |
+
"num_beam_groups": 1,
|
| 25 |
+
"num_beams": 4,
|
| 26 |
+
"num_return_sequences": 1,
|
| 27 |
+
"output_scores": false,
|
| 28 |
+
"pad_token_id": 1,
|
| 29 |
+
"remove_invalid_values": false,
|
| 30 |
+
"repetition_penalty": 1.0,
|
| 31 |
+
"return_dict_in_generate": false,
|
| 32 |
+
"target_lookbehind": 10,
|
| 33 |
+
"temperature": 1.0,
|
| 34 |
+
"top_k": 50,
|
| 35 |
+
"top_p": 1.0,
|
| 36 |
+
"transformers_version": "5.17.0",
|
| 37 |
+
"typical_p": 1.0,
|
| 38 |
+
"use_cache": true
|
| 39 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f5abf1dca96d32209dd053806876cd270d7a31bd5cff20b30a3767b3a2a85f7
|
| 3 |
+
size 557112860
|
sentencepiece.bpe.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f72f5d040a176945623a255484d24066f8c0da89a294359154e226efbe494b80
|
| 3 |
+
size 985833
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {},
|
| 3 |
+
"backend": "sentencepiece",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"clean_up_tokenization_spaces": true,
|
| 6 |
+
"cls_token": "<s>",
|
| 7 |
+
"eos_token": "</s>",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"__java__",
|
| 10 |
+
"__python__",
|
| 11 |
+
"__en_XX__"
|
| 12 |
+
],
|
| 13 |
+
"is_local": false,
|
| 14 |
+
"language_codes": "base",
|
| 15 |
+
"local_files_only": false,
|
| 16 |
+
"mask_token": "<mask>",
|
| 17 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 18 |
+
"pad_token": "<pad>",
|
| 19 |
+
"sep_token": "</s>",
|
| 20 |
+
"sp_model_kwargs": {},
|
| 21 |
+
"src_lang": "__python__",
|
| 22 |
+
"tgt_lang": "__en_XX__",
|
| 23 |
+
"tokenizer_class": "PLBartTokenizer",
|
| 24 |
+
"unk_token": "<unk>"
|
| 25 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:439b3b0ae8a178527241a62c7e36f5946896df4380366a7d0c8133d3d4797be1
|
| 3 |
+
size 5393
|