Text Generation
Transformers
Safetensors
English
multilingual
encoder-decoder
text2text-generation
code-to-docstring
code-summarization
code-documentation
code
python
java
huggingface
modernbert
gpt2
Instructions to use Shuu12121/CodeEncoderDecoderModel-Ghost-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Shuu12121/CodeEncoderDecoderModel-Ghost-large with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Shuu12121/CodeEncoderDecoderModel-Ghost-large")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Shuu12121/CodeEncoderDecoderModel-Ghost-large") model = AutoModelForSeq2SeqLM.from_pretrained("Shuu12121/CodeEncoderDecoderModel-Ghost-large") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Shuu12121/CodeEncoderDecoderModel-Ghost-large with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Shuu12121/CodeEncoderDecoderModel-Ghost-large" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Shuu12121/CodeEncoderDecoderModel-Ghost-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Shuu12121/CodeEncoderDecoderModel-Ghost-large
- SGLang
How to use Shuu12121/CodeEncoderDecoderModel-Ghost-large 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 "Shuu12121/CodeEncoderDecoderModel-Ghost-large" \ --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": "Shuu12121/CodeEncoderDecoderModel-Ghost-large", "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 "Shuu12121/CodeEncoderDecoderModel-Ghost-large" \ --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": "Shuu12121/CodeEncoderDecoderModel-Ghost-large", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Shuu12121/CodeEncoderDecoderModel-Ghost-large with Docker Model Runner:
docker model run hf.co/Shuu12121/CodeEncoderDecoderModel-Ghost-large
| { | |
| "architectures": [ | |
| "EncoderDecoderModel" | |
| ], | |
| "cache_dir": "./cache", | |
| "decoder": { | |
| "_attn_implementation_autoset": true, | |
| "_name_or_path": "openai-community/gpt2-large", | |
| "activation_function": "gelu_new", | |
| "add_cross_attention": true, | |
| "architectures": [ | |
| "GPT2LMHeadModel" | |
| ], | |
| "attn_pdrop": 0.1, | |
| "embd_pdrop": 0.1, | |
| "initializer_range": 0.02, | |
| "is_decoder": true, | |
| "layer_norm_epsilon": 1e-05, | |
| "model_type": "gpt2", | |
| "n_ctx": 1024, | |
| "n_embd": 1280, | |
| "n_head": 20, | |
| "n_inner": null, | |
| "n_layer": 36, | |
| "n_positions": 1024, | |
| "reorder_and_upcast_attn": false, | |
| "resid_pdrop": 0.1, | |
| "scale_attn_by_inverse_layer_idx": false, | |
| "scale_attn_weights": true, | |
| "summary_activation": null, | |
| "summary_first_dropout": 0.1, | |
| "summary_proj_to_labels": true, | |
| "summary_type": "cls_index", | |
| "summary_use_proj": true, | |
| "task_specific_params": { | |
| "text-generation": { | |
| "do_sample": true, | |
| "max_length": 50 | |
| } | |
| }, | |
| "torch_dtype": "float32", | |
| "use_cache": true, | |
| "vocab_size": 50257 | |
| }, | |
| "decoder_start_token_id": 50256, | |
| "encoder": { | |
| "_attn_implementation_autoset": true, | |
| "_name_or_path": "Shuu12121/CodeModernBERT-Ghost", | |
| "architectures": [ | |
| "ModernBertForMaskedLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "attention_probs_dropout_prob": 0.1, | |
| "bos_token_id": 50000, | |
| "classifier_activation": "gelu", | |
| "classifier_bias": false, | |
| "classifier_dropout": 0.0, | |
| "classifier_pooling": "cls", | |
| "cls_token_id": 50281, | |
| "decoder_bias": true, | |
| "deterministic_flash_attn": false, | |
| "embedding_dropout": 0.0, | |
| "eos_token_id": 50001, | |
| "global_attn_every_n_layers": 3, | |
| "global_rope_theta": 160000.0, | |
| "hidden_activation": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 768, | |
| "initializer_cutoff_factor": 2.0, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "local_attention": 128, | |
| "local_attention_rope_theta": 10000, | |
| "local_attention_window": 128, | |
| "local_rope_theta": 10000.0, | |
| "max_position_embeddings": 2048, | |
| "mlp_bias": false, | |
| "mlp_dropout": 0.0, | |
| "model_type": "modernbert", | |
| "norm_bias": false, | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": 0, | |
| "repad_logits_with_grad": false, | |
| "rope_theta": 160000, | |
| "sparse_pred_ignore_index": -100, | |
| "sparse_prediction": false, | |
| "torch_dtype": "float32", | |
| "type_vocab_size": 2, | |
| "vocab_size": 50004 | |
| }, | |
| "eos_token_id": 50256, | |
| "is_encoder_decoder": true, | |
| "model_type": "encoder-decoder", | |
| "pad_token_id": 50256, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.51.1" | |
| } | |