Instructions to use Canstralian/pentest_ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Canstralian/pentest_ai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Canstralian/pentest_ai")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Canstralian/pentest_ai", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Canstralian/pentest_ai with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Canstralian/pentest_ai" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Canstralian/pentest_ai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Canstralian/pentest_ai
- SGLang
How to use Canstralian/pentest_ai 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 "Canstralian/pentest_ai" \ --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": "Canstralian/pentest_ai", "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 "Canstralian/pentest_ai" \ --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": "Canstralian/pentest_ai", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Canstralian/pentest_ai with Docker Model Runner:
docker model run hf.co/Canstralian/pentest_ai
Model not available
#1
by mbx123 - opened
Hey, I receive this error on trying to use the model. Am I doing something wrong or is this model not yet available? I used the suggested implementation from the model card
File "/pkg/modal/_runtime/container_io_manager.py", line 728, in handle_input_exception
yield
File "/pkg/modal/_container_entrypoint.py", line 240, in run_input_sync
res = io_context.call_finalized_function()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pkg/modal/_runtime/container_io_manager.py", line 180, in call_finalized_function
res = self.finalized_function.callable(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/main_basic.py", line 195, in pentest
model = AutoModelForCausalLM.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 526, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/models/auto/configuration_auto.py", line 1112, in from_pretrained
raise ValueError(
ValueError: Unrecognized model in Canstralian/pentest_ai. Should have a `model_type` key in its config.json, or contain one of the following strings in its name: [...]
```
I have the same problem too "ValueError: Unrecognized model in Canstralian/pentest_ai. Should have a model_type key in its config.json, or contain one of the following strings in its name"