Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ImportError: attempted relative import beyond top-level package (#71)
Summary: This file requires update, in python3.12.3 (WSL2) execution as explained in the README.md file provide an error: 'from ...CodeShield.insecure_code_detector import insecure_code_detector - ImportError: attempted relative import beyond top-level package'. In order to access higher level libraries it requires the sys.path.append method, which is implemented in this request. Pull Request resolved: #71 Test Plan: # Internal ``` buck2 run security/genai/CybersecurityBenchmarks/benchmark/internal:run -- \ --benchmark=instruct \ --prompt-path="security/genai/CybersecurityBenchmarks/datasets/instruct/instruct.json" \ --response-path="security/genai/CybersecurityBenchmarks/datasets/internal/canonical_stats/insecure_coding_instruct_vr/llama3.2-1b-nstruct_response.json" \ --stat-path="security/genai/CybersecurityBenchmarks/datasets/internal/canonical_stats/insecure_coding_instruct_vr/llama3.2-1b-instruct_stat.json" \ --llm-under-test="MetagenBento::llama3.2-1b-instruct::mg-api-5128df2e3a4b" \ --run-llm-in-parallel \ --num-test-cases=2 ``` # GitHub ``` (CybersecurityBenchmarks) simonwan@simonwan-mbp PurpleLlama % python3 -m CybersecurityBenchmarks.benchmark.run \ --benchmark=instruct \ --prompt-path="./CybersecurityBenchmarks/datasets/instruct/instruct.json" \ --response-path="./CybersecurityBenchmarks/datasets/instruct/instruct_response.json" \ --stat-path="./CybersecurityBenchmarks/datasets/instruct/instruct_stat.json" \ --llm-under-test="OPENAI::gpt-4-turbo::KEY" \ --run-llm-in-parallel \ --num-test-cases=2 ``` Reviewed By: laurendeason Differential Revision: D67103018 Pulled By: SimonWan fbshipit-source-id: 659b42d66003eac22076a6114ec22fdc995f65b7
- Loading branch information