From 2d8d7e021515a625862e0ed0eb202f4c56e66418 Mon Sep 17 00:00:00 2001 From: Raja Sekhar Rao Dheekonda <43563047+rdheekonda@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:42:32 -0800 Subject: [PATCH 1/2] Fix TAP Orchestrator Invalid Argument (#561) Co-authored-by: rdheekonda --- pyrit/orchestrator/tree_of_attacks_with_pruning_orchestrator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyrit/orchestrator/tree_of_attacks_with_pruning_orchestrator.py b/pyrit/orchestrator/tree_of_attacks_with_pruning_orchestrator.py index 84c1867c..911350d9 100644 --- a/pyrit/orchestrator/tree_of_attacks_with_pruning_orchestrator.py +++ b/pyrit/orchestrator/tree_of_attacks_with_pruning_orchestrator.py @@ -357,13 +357,11 @@ async def apply_attack_strategy_async(self): cloned_orchestrator._memory.duplicate_conversation_for_new_orchestrator( new_orchestrator_id=cloned_orchestrator.get_identifier()["id"], conversation_id=orchestrator._prompt_target_conversation_id, - new_conversation_id=cloned_orchestrator._prompt_target_conversation_id, ) cloned_orchestrator._memory.duplicate_conversation_for_new_orchestrator( new_orchestrator_id=cloned_orchestrator.get_identifier()["id"], conversation_id=orchestrator._red_teaming_chat_conversation_id, - new_conversation_id=cloned_orchestrator._red_teaming_chat_conversation_id, ) cloned_orchestrators.append(cloned_orchestrator) From e4cb06f281f6c10c2afe2d676c8101bb0b3e0a39 Mon Sep 17 00:00:00 2001 From: Volkan Kutal <50370416+KutalVolkan@users.noreply.github.com> Date: Sat, 16 Nov 2024 20:37:47 +0100 Subject: [PATCH 2/2] DOC: Relocate use_huggingface_chat_target notebook and script to targets directory (#558) --- doc/_toc.yml | 2 +- .../use_huggingface_chat_target.ipynb | 63 +------------------ .../use_huggingface_chat_target.py | 0 3 files changed, 4 insertions(+), 61 deletions(-) rename doc/code/{orchestrators => targets}/use_huggingface_chat_target.ipynb (74%) rename doc/code/{orchestrators => targets}/use_huggingface_chat_target.py (100%) diff --git a/doc/_toc.yml b/doc/_toc.yml index f81cd1ff..af6aad81 100644 --- a/doc/_toc.yml +++ b/doc/_toc.yml @@ -42,7 +42,6 @@ chapters: - file: code/orchestrators/pku_safe_rlhf_testing - file: code/orchestrators/seclists_bias_testing - file: code/orchestrators/tree_of_attacks_with_pruning - - file: code/orchestrators/use_huggingface_chat_target - file: code/orchestrators/violent_durian - file: code/orchestrators/xstest_bias_testing - file: code/targets/0_prompt_targets @@ -56,6 +55,7 @@ chapters: - file: code/targets/7_http_target - file: code/targets/open_ai_completions - file: code/targets/prompt_shield_target + - file: code/targets/use_huggingface_chat_target - file: code/converters/0_converters sections: - file: code/converters/1_llm_converters diff --git a/doc/code/orchestrators/use_huggingface_chat_target.ipynb b/doc/code/targets/use_huggingface_chat_target.ipynb similarity index 74% rename from doc/code/orchestrators/use_huggingface_chat_target.ipynb rename to doc/code/targets/use_huggingface_chat_target.ipynb index eccc6bbe..5e318e41 100644 --- a/doc/code/orchestrators/use_huggingface_chat_target.ipynb +++ b/doc/code/targets/use_huggingface_chat_target.ipynb @@ -37,7 +37,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "940f8d8a", "metadata": { "execution": { @@ -47,64 +47,7 @@ "shell.execute_reply": "2024-11-11T22:43:23.862727Z" } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Running model: HuggingFaceTB/SmolLM-135M-Instruct\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Average response time for HuggingFaceTB/SmolLM-135M-Instruct: 37.12 seconds\n", - "\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m\u001b[39mConversation ID: 5223e15e-f21c-4d15-88af-8c02d6558182\n", - "\u001b[1m\u001b[34muser: What is 4*4? Give me the solution.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m\u001b[33massistant: What a great question!\n", - "\n", - "The number 4*4 is a special number because it can be expressed as a product of two numbers,\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m\u001b[39mConversation ID: b0238d3e-ce2e-48c3-a5e1-eaebf2c58e6f\n", - "\u001b[1m\u001b[34muser: What is 3*3? Give me the solution.\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m\u001b[33massistant: What a great question!\n", - "\n", - "The number 3*3 is a fascinating number that has been a subject of fascination for mathematicians and computer scientists for\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "HuggingFaceTB/SmolLM-135M-Instruct: 37.12 seconds\n" - ] - } - ], + "outputs": [], "source": [ "import time\n", "from pyrit.prompt_target import HuggingFaceChatTarget\n", @@ -166,7 +109,7 @@ "kernelspec": { "display_name": "pyrit-dev", "language": "python", - "name": "pyrit-dev" + "name": "python3" }, "language_info": { "codemirror_mode": { diff --git a/doc/code/orchestrators/use_huggingface_chat_target.py b/doc/code/targets/use_huggingface_chat_target.py similarity index 100% rename from doc/code/orchestrators/use_huggingface_chat_target.py rename to doc/code/targets/use_huggingface_chat_target.py