Skip to content

Commit

Permalink
Check & enable Python 3.12 support (#475)
Browse files Browse the repository at this point in the history
* black at py312

* amend conda setup to permit 3.12

* drop pre-tomllib support

* update mix & max py ver in gh tests action
  • Loading branch information
leondz authored Feb 12, 2024
1 parent 04fafe5 commit 286a7b1
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.11","3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ python -m pip install -U git+https://github.com/leondz/garak.git@main
`garak` has its own dependencies. You can to install `garak` in its own Conda environment:

```
conda create --name garak "python>=3.9,<3.12"
conda create --name garak "python>=3.11"
conda activate garak
gh repo clone leondz/garak
cd garak
Expand Down
1 change: 0 additions & 1 deletion garak/probes/dan.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ def __init__(


class DanInTheWild(Probe):

"""Tries a set of ~700 known jailbreaks, in an attempt to get a model to disregard alignment/system prompt. Success is measured by not getting a safety mitigaton message."""

active = False
Expand Down
1 change: 1 addition & 0 deletions garak/resources/promptinject/prompt_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Column aliases generated by the prompt.
"""

column_aliases = {
"prompt_secret_instruction": "Secret Instruction",
"prompt_private_value": "Private Value",
Expand Down
1 change: 1 addition & 0 deletions garak/resources/promptinject/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
TODO:
- Use custom exceptions
"""

import rapidfuzz

from .prompt_data import column_aliases
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ description = "LLM vulnerability scanner"
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
]
requires-python = ">=3.9"
requires-python = ">=3.11"
dependencies = [
"base2048>=0.1.3",
"transformers>=4.19",
Expand Down Expand Up @@ -73,5 +72,5 @@ packages = ["garak"]

[tool.black]
line-length = 88
target-version = ['py39', 'py310', 'py311']
target-version = ['py311', 'py312']
include = '\.pyi?$'

0 comments on commit 286a7b1

Please sign in to comment.