Skip to content

Prepare for multiple pipelines

Hongtao Yang requested to merge multi-pipeline into main

What does this merge request do and why?

Refactor the top-level cli interface to facilitate for multiple pipelines.

There are 2 command groups

  • code-suggestion: all pipelines relates to code-suggestion goes here. Currently only one, but we'll add another pipeline to generate all testcases very soon. Some unused pipelines are deleted.
  • duo-chat: just placeholder for now.

Also added some colored documentations. Just run python promptlib/main.py --help too see them.

Output for running poetry run promptlib code-suggestion eval --helpScreenshot_2023-10-04_at_2.34.12_pm

How to set up and validate locally

  1. Rerun poetry install to install this updated version of prompt library.
  2. Example command to run the pipeline
poetry run promptlib code-suggestion\
    --runner DirectRunner \
    --project unreview-poc-390200e5 \
    --region us-central1 \
    --temp-location "gs://unreview-dataflow/tmp/" \
    --save-main-session \
    eval \
    --input-bq-table unreview-poc-390200e5.gl_gitlab_codebase.input_raw_v1 \
    --output-bq-table unreview-poc-390200e5:gl_gitlab_experiments.temp_pipeline_refactoring \
    --include-suffix \
    --throttle_sec 0.01 \
    --num-samples-per-file 1 \
    --batch-size 24 \
    --min-length 25 \
    --language c \
    --transformation function_signatures \
    --transformation imports \
    --transformation file_name_and_language \
    --model code-gecko@001
  1. There is a typo in the above command, and you'll see that typer catches it.

Merge request checklist

  • I've ran the eval_codebase.py pipeline to validate that nothing is broken. See this table.
  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Hongtao Yang

Merge request reports

Loading