Instructions to use dessertlab/offensive-powershell-CodeGPT-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dessertlab/offensive-powershell-CodeGPT-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dessertlab/offensive-powershell-CodeGPT-small")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dessertlab/offensive-powershell-CodeGPT-small") model = AutoModelForCausalLM.from_pretrained("dessertlab/offensive-powershell-CodeGPT-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dessertlab/offensive-powershell-CodeGPT-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dessertlab/offensive-powershell-CodeGPT-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dessertlab/offensive-powershell-CodeGPT-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dessertlab/offensive-powershell-CodeGPT-small
- SGLang
How to use dessertlab/offensive-powershell-CodeGPT-small 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 "dessertlab/offensive-powershell-CodeGPT-small" \ --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": "dessertlab/offensive-powershell-CodeGPT-small", "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 "dessertlab/offensive-powershell-CodeGPT-small" \ --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": "dessertlab/offensive-powershell-CodeGPT-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dessertlab/offensive-powershell-CodeGPT-small with Docker Model Runner:
docker model run hf.co/dessertlab/offensive-powershell-CodeGPT-small
Upload model
Browse files- config.json +36 -0
- generation_config.json +7 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "cridin1/CodeGPT-small-py-30-1-powershell-last",
|
| 3 |
+
"_num_labels": 2,
|
| 4 |
+
"activation_function": "gelu_new",
|
| 5 |
+
"architectures": [
|
| 6 |
+
"GPT2LMHeadModel"
|
| 7 |
+
],
|
| 8 |
+
"attn_pdrop": 0.1,
|
| 9 |
+
"bos_token_id": 0,
|
| 10 |
+
"embd_pdrop": 0.1,
|
| 11 |
+
"eos_token_id": 2,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "gpt2",
|
| 15 |
+
"n_ctx": 1024,
|
| 16 |
+
"n_embd": 768,
|
| 17 |
+
"n_head": 12,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 12,
|
| 20 |
+
"n_positions": 1024,
|
| 21 |
+
"output_past": true,
|
| 22 |
+
"pad_token_id": 1,
|
| 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 |
+
"torch_dtype": "float32",
|
| 33 |
+
"transformers_version": "4.33.2",
|
| 34 |
+
"use_cache": true,
|
| 35 |
+
"vocab_size": 50001
|
| 36 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"pad_token_id": 1,
|
| 6 |
+
"transformers_version": "4.33.2"
|
| 7 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:becaedefe2152a5d109f955a28bec2773d28990ddcfaac29092c3ac1aa4e6816
|
| 3 |
+
size 497019162
|