Skip to content

Draft: Architecture change

Victor Amblard requested to merge remove_patches into main

Currently most of the code that adapts existing detectors to integrate them in our framework is located in patches which are applied to each of the detectors after their installation. Although this approach works, it makes it difficult to track changes and is highly sensitive to changes in the detector's code (it rewrites the code line-by-line).

We propose to transfer most of the code currently written in patches to dedicated methods in each of the detectors classes (located in `src/generated_text_detection/detectors).

Specifically, with this new approach:

  • patches will be strictly limited to bug fixes in the original code (missing dependency in a requirements.txt for instance) so that the original repo

  • three methods are added to Detector class: preprocess, postprocess and run_script that convert our input to a valid input for a given detector and converts the detector's output to our standardized output. run_script calls the (unpatched) detector's script (for instance local_infer.py for FastDetectGPT)

  • Implementation in detectors/base.py

  • FastDetectGPT implementation

  • xmlr implmementation

Edited by Victor Amblard

Merge request reports

Loading