From 44c695c00b0cc99b75feaa50c68d8f8b4b861842 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:50:35 +0000 Subject: [PATCH 1/4] feat: Updated README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1212b93..308dfe6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ PullingAce is a Python library designed to benchmark adversarial attacks on Hugg ## Installation -To get started with PullingAce, you can install it using pip: +To get started with PullingAce, follow these steps: + +- Clone the repository: `git clone https://github.com//pullingace.git` +- Navigate to the root directory: `cd pullingace` +- Install the package using pip: ```bash pip install pullingace @@ -29,6 +33,31 @@ pullingace --attack tomato --model "textattack/albert-base-v2-ag-news" --dataset ``` ## Credits +## Features for Generative Models +======= +## Features for Generative Models + +- **Prompt Injection**: PullingAce integrates the prompt injection feature from the Garak library, allowing for more dynamic and flexible adversarial attacks. +- **Toxicity Features**: PullingAce incorporates Garak's toxicity features, providing additional metrics for evaluating model robustness. +- **Garak Integration**: By integrating features from the Garak library, PullingAce offers a wider range of attack strategies and evaluation metrics. + +### CLI Example +```bash +# Replace with a specific command for prompt injection +pullingace --attack promptinjection --model "textattack/albert-base-v2-ag-news" --dataset "ag_news" --num-examples 5 +``` +## Features for Classification +======= +## Features for Classification + +### CLI Example +```bash +pullingace --attack tomato --model "textattack/albert-base-v2-ag-news" --dataset "ag_news" --num-examples 5 +``` + +### How is PullingAce different from TextAttack? + +PullingAce uses built-in recipes from the TextAttack library but provides additional features and customizations. This package was created with Cookiecutter and the [sourcery-ai/python-best-practices-cookiecutter](https://github.com/sourcery-ai/python-best-practices-cookiecutter) project template. From 843f15fc5cc63448ef8d04c99601851ac5f2863c Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:58:07 +0000 Subject: [PATCH 2/4] fix: specify target files for mypy in GitHub Actio --- .github/workflows/python-app.yml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..eb69a26 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,33 @@ +name: Python application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: 3.10 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv + pipenv install --dev + - name: Lint with flake8 + run: | + pipenv run flake8 pulling_ace tests + - name: Test with pytest + run: | + pipenv run pytest + - name: Typecheck with mypy + run: | + pipenv run mypy pulling_ace/*.py From fcf82711726a7df70b7056418aef9f2ab5feb1bf Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:00:01 +0000 Subject: [PATCH 3/4] feat: Updated .github/workflows/python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index eb69a26..11e8b40 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -30,4 +30,4 @@ jobs: pipenv run pytest - name: Typecheck with mypy run: | - pipenv run mypy pulling_ace/*.py + pipenv run mypy pulling_ace/**/*.py From 8a5c6223496f938d03d61282da693da466acf581 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 15:00:32 +0000 Subject: [PATCH 4/4] feat: Updated Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4443e6b..06470fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy FROM base AS runtime # Copy virtual env from python-deps stage -COPY --from=python-deps /.venv /.venv +COPY --from=python-deps /app/.venv /app/.venv ENV PATH="/.venv/bin:$PATH" # Create and switch to a new user