From 9ff26afd97acee0ff4901350f509af59a5511778 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:49:11 +0000 Subject: [PATCH 01/16] feat/fix: the commit message --- file_diff | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 file_diff diff --git a/file_diff b/file_diff new file mode 100644 index 0000000..6fc98b6 --- /dev/null +++ b/file_diff @@ -0,0 +1,16 @@ +// file_diff + +/** + * Update the commit message to provide a clear and concise explanation of the changes made in the commit. + * Replace the existing commit message with a new commit message that describes the purpose of the changes made. + * Ensure that the new commit message is clear, concise, and provides enough information about the changes made. + */ + +const updateCommitMessage = (commitMessage) => { + const newCommitMessage = "feat/fix: the commit message"; // Replace with the desired commit message + return newCommitMessage; +}; + +module.exports = { + updateCommitMessage, +}; From da24c9d36480a0c5b2ed7987a868ed3100d1f90d Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:59:07 +0000 Subject: [PATCH 02/16] feat: Updated Dockerfile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index 7679dde..7ce674d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,3 +36,9 @@ COPY . . # Run the executable ENTRYPOINT ["python", "-m", "beyond_the_nest"] CMD ["10"] +# Install the module from the current directory +RUN pip install -e . + +# Run the executable +ENTRYPOINT ["python", "-m", "beyond_the_nest"] +CMD ["10"] From 32d72372c98ba55ca99e8902848e7bffaa5c00f8 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:05:24 +0000 Subject: [PATCH 03/16] feat: Updated Dockerfile --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7ce674d..6f208d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,6 @@ USER appuser # Install application into container COPY . . -# Run the executable -ENTRYPOINT ["python", "-m", "beyond_the_nest"] -CMD ["10"] # Install the module from the current directory RUN pip install -e . From 8b8db803227c22e746c3f331bbe7e117ae7dc659 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:12:07 +0000 Subject: [PATCH 04/16] feat: Updated pulling_ace/__main__.py --- pulling_ace/__main__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pulling_ace/__main__.py b/pulling_ace/__main__.py index 2c8aa59..e0cceae 100644 --- a/pulling_ace/__main__.py +++ b/pulling_ace/__main__.py @@ -7,5 +7,16 @@ input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" generated_text = generate_text(text_gen_pipeline, input_text) +if __name__ == "__main__": + generate_text +import beyond_the_nest + +# Example usage: +model_name = "tiiuae/falcon-7b-instruct" +text_gen_pipeline = load_transformers_model(model_name) + +input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" +generated_text = generate_text(text_gen_pipeline, input_text) + if __name__ == "__main__": generate_text From 58e9f4b76efccb5a9888a5dc5f2f2b2414af19d8 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:17:52 +0000 Subject: [PATCH 05/16] feat: Updated pulling_ace/__main__.py --- pulling_ace/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pulling_ace/__main__.py b/pulling_ace/__main__.py index e0cceae..fa224db 100644 --- a/pulling_ace/__main__.py +++ b/pulling_ace/__main__.py @@ -1,3 +1,4 @@ +import beyond_the_nest from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model # Example usage: From d442186aed2b207f2d3e8ab6b226a511ca9f32d4 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:24:35 +0000 Subject: [PATCH 06/16] feat: Updated Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f208d1..e1f8b2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,9 @@ USER appuser # Install application into container COPY . . -# Install the module from the current directory -RUN pip install -e . # Run the executable ENTRYPOINT ["python", "-m", "beyond_the_nest"] CMD ["10"] +# Install the module from the current directory +RUN pip install -e . From 15e6275f38dabed43a397dee51c25d2a835d8515 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 21:30:37 +0000 Subject: [PATCH 07/16] feat: Updated pulling_ace/cli.py --- pulling_ace/cli.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pulling_ace/cli.py b/pulling_ace/cli.py index 84204c2..656fe2c 100644 --- a/pulling_ace/cli.py +++ b/pulling_ace/cli.py @@ -1,5 +1,9 @@ # inside cli.py +import beyond_the_nest + +# inside cli.py + import argparse from .attacks.tomato_attack import perform_tomato_attack From 4b177edab481358514a6ff70554d14281238573e Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:04:59 +0000 Subject: [PATCH 08/16] feat: Updated file_diff --- file_diff | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/file_diff b/file_diff index 6fc98b6..3740f0b 100644 --- a/file_diff +++ b/file_diff @@ -6,6 +6,13 @@ * Ensure that the new commit message is clear, concise, and provides enough information about the changes made. */ +const updateCommitMessage = (commitMessage) => { + // Modify the updateCommitMessage function to include a detailed comment explaining its purpose and how it updates the commit message + // This function takes the existing commit message as input and returns a new commit message with the desired format + const newCommitMessage = "feat/fix: Update the commit message to provide a clear and concise explanation of the changes made"; // Replace with the desired commit message + return newCommitMessage; +}; + const updateCommitMessage = (commitMessage) => { const newCommitMessage = "feat/fix: the commit message"; // Replace with the desired commit message return newCommitMessage; From a2fa2909b6d13526326bafe7a6ccdb3235c60396 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:05:43 +0000 Subject: [PATCH 09/16] feat: Updated setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 068f506..398e1c6 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ "pullingace = pulling_ace.cli:main", ], }, - "trunk>=1.18.0", + ), "console_scripts": [ "pullingace = pulling_ace.cli:main", ], From 4b6cdd64c108fec749820b2f4503abbf92ec3474 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:06:29 +0000 Subject: [PATCH 10/16] feat: Updated pulling_ace/__main__.py --- pulling_ace/__main__.py | 57 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/pulling_ace/__main__.py b/pulling_ace/__main__.py index fa224db..7fe06e2 100644 --- a/pulling_ace/__main__.py +++ b/pulling_ace/__main__.py @@ -1,4 +1,54 @@ -import beyond_the_nest +# Code +File path: pulling_ace/__main__.py + +# This file contains the main entry point for the pulling_ace module. +# It imports the necessary modules and defines the main function for generating text using the beyond_the_nest library. + +from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model + +# Example usage: +model_name = "tiiuae/falcon-7b-instruct" +text_gen_pipeline = load_transformers_model(model_name) + +input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" +# Generate text using the text_gen_pipeline +generated_text = generate_text(text_gen_pipeline, input_text) + +if __name__ == "__main__": + # Code + File path: pulling_ace/__main__.py + + # This file contains the main entry point for the pulling_ace module. + # It imports the necessary modules and defines the main function for generating text using the beyond_the_nest library. + + from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model + + # Example usage: + model_name = "tiiuae/falcon-7b-instruct" + text_gen_pipeline = load_transformers_model(model_name) + + input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" + # Generate text using the text_gen_pipeline + generated_text = generate_text(text_gen_pipeline, input_text) + + # Main entry point + if __name__ == "__main__": + generate_text +from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model + +# Example usage: +model_name = "tiiuae/falcon-7b-instruct" +text_gen_pipeline = load_transformers_model(model_name) + +input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" +generated_text = generate_text(text_gen_pipeline, input_text) + +# Code +File path: pulling_ace/__main__.py + +# This file contains the main entry point for the pulling_ace module. +# It imports the necessary modules and defines the main function for generating text using the beyond_the_nest library. + from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model # Example usage: @@ -6,11 +56,14 @@ text_gen_pipeline = load_transformers_model(model_name) input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" +# Generate text using the text_gen_pipeline generated_text = generate_text(text_gen_pipeline, input_text) +# Main entry point if __name__ == "__main__": generate_text -import beyond_the_nest +# Update the commit message to provide a clear and concise explanation of the changes made +newCommitMessage = updateCommitMessage(commitMessage) # Example usage: model_name = "tiiuae/falcon-7b-instruct" From d11e948055489b56392e10f11cb23d1ce8998f14 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:06:53 +0000 Subject: [PATCH 11/16] feat: Updated Dockerfile --- Dockerfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40855c1..8252f7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,12 +30,5 @@ RUN useradd --create-home appuser WORKDIR /home/appuser USER appuser -ENTRYPOINT ["python", "-m", "pulling_ace.cli"] -CMD ["10"] - - -# Run the executable -ENTRYPOINT ["python", "-m", "pulling_ace.cli"] -CMD ["10"] # Install the module from the current directory RUN pip install -e . From 639fb2cece8c0471aa79d02279901e265dc4b3cb Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:07:16 +0000 Subject: [PATCH 12/16] feat: Updated pulling_ace/cli.py --- pulling_ace/cli.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pulling_ace/cli.py b/pulling_ace/cli.py index 656fe2c..74f0a04 100644 --- a/pulling_ace/cli.py +++ b/pulling_ace/cli.py @@ -1,9 +1,36 @@ # inside cli.py -import beyond_the_nest +# This file contains the command-line interface for the PullingAce module. +# It imports the necessary modules and defines the main function for executing the tomato attack. +import argparse + +from .attacks.tomato_attack import perform_tomato_attack + + +def main(): + parser = argparse.ArgumentParser(description="PullingAce.") + parser.add_argument("--attack", type=str, help="Attack type") + parser.add_argument("--model", type=str, help="Model to use") + parser.add_argument("--dataset", type=str, help="Dataset to use") + parser.add_argument( + "--num-examples", type=int, default=10, help="Number of examples for the attack" + ) # New argument + + args = parser.parse_args() + + if args.attack == "tomato": + results = perform_tomato_attack(args.model, args.dataset, args.num_examples) + print(results) + + +if __name__ == "__main__": + main() # inside cli.py +# This file contains the command-line interface for the PullingAce module. +# It imports the necessary modules and defines the main function for executing the tomato attack. + import argparse from .attacks.tomato_attack import perform_tomato_attack From 475a8a7c887ac0115d69763a110db26f6ed585ab Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:07:55 +0000 Subject: [PATCH 13/16] feat: Updated pulling_ace/__main__.py --- pulling_ace/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pulling_ace/__main__.py b/pulling_ace/__main__.py index 7fe06e2..f96b746 100644 --- a/pulling_ace/__main__.py +++ b/pulling_ace/__main__.py @@ -34,9 +34,8 @@ # Main entry point if __name__ == "__main__": generate_text -from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model +from beyond_the_nest.beyond_the_nest import load_transformers_model -# Example usage: model_name = "tiiuae/falcon-7b-instruct" text_gen_pipeline = load_transformers_model(model_name) @@ -74,3 +73,6 @@ if __name__ == "__main__": generate_text +# Main entry point +if __name__ == "__main__": + generate_text From 4496bd083942911ce3b3fd785f1fb9570cc8506c Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:08:22 +0000 Subject: [PATCH 14/16] feat: Updated pulling_ace/cli.py --- pulling_ace/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pulling_ace/cli.py b/pulling_ace/cli.py index 74f0a04..3c398c7 100644 --- a/pulling_ace/cli.py +++ b/pulling_ace/cli.py @@ -5,7 +5,7 @@ import argparse -from .attacks.tomato_attack import perform_tomato_attack +# Remove the duplicate import statement for beyond_the_nest def main(): @@ -19,6 +19,9 @@ def main(): args = parser.parse_args() + # Add the correct import statement for perform_tomato_attack from .attacks.tomato_attack + from .attacks.tomato_attack import perform_tomato_attack + if args.attack == "tomato": results = perform_tomato_attack(args.model, args.dataset, args.num_examples) print(results) From 19ebf74e09876170cf59be8e737cb7d5ba2c6f49 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:09:17 +0000 Subject: [PATCH 15/16] feat: Updated pulling_ace/__main__.py --- pulling_ace/__main__.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pulling_ace/__main__.py b/pulling_ace/__main__.py index f96b746..1891275 100644 --- a/pulling_ace/__main__.py +++ b/pulling_ace/__main__.py @@ -6,14 +6,16 @@ from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model -# Example usage: model_name = "tiiuae/falcon-7b-instruct" text_gen_pipeline = load_transformers_model(model_name) input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" -# Generate text using the text_gen_pipeline generated_text = generate_text(text_gen_pipeline, input_text) +# Main entry point +if __name__ == "__main__": + generate_text + if __name__ == "__main__": # Code File path: pulling_ace/__main__.py @@ -49,6 +51,21 @@ # It imports the necessary modules and defines the main function for generating text using the beyond_the_nest library. from beyond_the_nest.beyond_the_nest import generate_text, load_transformers_model +# Update the commit message to provide a clear and concise explanation of the changes made +newCommitMessage = updateCommitMessage(commitMessage) + +# Example usage: +model_name = "tiiuae/falcon-7b-instruct" +text_gen_pipeline = load_transformers_model(model_name) + +input_text = "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:" +generated_text = generate_text(text_gen_pipeline, input_text) + +if __name__ == "__main__": + generate_text +# Main entry point +if __name__ == "__main__": + generate_text # Example usage: model_name = "tiiuae/falcon-7b-instruct" From 1b4ec92fcd4ec45d1b0327fe419a42321bd55ef8 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:09:56 +0000 Subject: [PATCH 16/16] feat: Updated pulling_ace/cli.py --- pulling_ace/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pulling_ace/cli.py b/pulling_ace/cli.py index 3c398c7..a5b3cb7 100644 --- a/pulling_ace/cli.py +++ b/pulling_ace/cli.py @@ -5,7 +5,7 @@ import argparse -# Remove the duplicate import statement for beyond_the_nest +from .attacks.tomato_attack import perform_tomato_attack def main(): @@ -19,8 +19,9 @@ def main(): args = parser.parse_args() - # Add the correct import statement for perform_tomato_attack from .attacks.tomato_attack - from .attacks.tomato_attack import perform_tomato_attack + if args.attack == "tomato": + results = perform_tomato_attack(args.model, args.dataset, args.num_examples) + print(results) if args.attack == "tomato": results = perform_tomato_attack(args.model, args.dataset, args.num_examples)