Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep Rules] Update commit message in file_diff #6

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +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 .
23 changes: 23 additions & 0 deletions file_diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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) => {
// 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;
};

module.exports = {
updateCommitMessage,
};
84 changes: 84 additions & 0 deletions pulling_ace/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,58 @@
# 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

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)

# Main entry point
if __name__ == "__main__":
generate_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 load_transformers_model

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
# 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"
Expand All @@ -9,3 +63,33 @@

if __name__ == "__main__":
generate_text
# Main entry point
if __name__ == "__main__":
generate_text

# 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
# 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
35 changes: 35 additions & 0 deletions pulling_ace/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# 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


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 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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"pullingace = pulling_ace.cli:main",
],
},
"trunk>=1.18.0",
),
"console_scripts": [
"pullingace = pulling_ace.cli:main",
],
Expand Down