Files
react-native-devtools-frontend/scripts/freestyler
Alex Rudenko bf9bcbf328 A helper script to convert to tsv
Bug: 379059135
Change-Id: I555f763d2123f1cb1b39fd3ae9468bb0f69613f1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6038154
Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>
Commit-Queue: Ergün Erdoğmuş <ergunsh@chromium.org>
Auto-Submit: Alex Rudenko <alexrudenko@chromium.org>
2024-11-21 12:27:51 +00:00
..
2024-11-21 12:27:51 +00:00

Freestyler Evaluation

This directory contains scripts for the prompt iteration & evaluation process for Freestyler.

Mainly, auto_freestyler.js script takes example URLs, runs the examples and outputs the results to the data/ directory. Then, the HTML page in eval/ folder takes these results and presents them in a UI for evaluation.

Running auto freestyler

Prerequisites

  • You need to have at least Node v20 to run Auto Freestyler.
  • You need to have a version of Chrome that contains the Freestyler feature. (i.e. you also need to be logged in & have sync enabled)

Steps

  1. Run a Freestyler enabled Chrome executable with --remote-debugging-port 9222 and --auto-open-devtools-for-tabs targeting about:blank. For example:
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --remote-debugging-port=9222 --auto-open-devtools-for-tabs about:blank
  1. Make sure you use en-US locale in DevTools.

  2. Close the DevTools window for the initial about:blank page but keep the tab open.

  3. Run the following command

node scripts/freestyler/auto_freestyler.js --example-urls <example-url-1> <example-url-2>

At the end of these steps, the examples in the urls <example-url-1> and <example-url-2> should be run and the results must be saved to the data/ folder.

Tip: You can add a --label <label> argument to the run to label the dataset. For example:

node scripts/freestyler/auto_freestyler.js --label title-change --example-urls <example-url-1> <example-url-2>

Evaluating the results

Steps

  1. Serve the scripts/freestyler folder by using a simple file server. For example:
python3 -m http.server
  1. Visit http://localhost:8000/eval URL to see the UI.
  2. Select the dataset you want to evaluate in the UI. (Dataset: selector)
  3. Evaluate the examples one by one.

Tip: You can navigate the questions with Tab key and move between examples with ArrowLeft and ArrowRight.