Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Gradio HiTL Scorer #722

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mart123p
Copy link
Contributor

Description

This PR introduces a new UI for scoring using Gradio, which improves the user experience by running in a separate process.

UI Implementation

The new UI is implemented using Gradio and runs in a different process. This allows the UI to wait on scoring tasks and respond accordingly, preventing the UI from flashing and ensuring it remains on screen throughout the scoring process.

Communication Mechanism

The communication between the UI and the scoring process is done using rpyc, which implements an RPC mechanism on localhost.

Gradio Features

Gradio allows us to display more than just messages. We can display entire conversations or even multimedia content. By default, the Gradio HiTL will be launched in a web view, but the web browser can be opened by setting the argument open_browser to true.

Platform Support

Currently, this implementation supports Windows and is limited to string scoring. Future updates will include support for other platforms and content types.

Dependency Changes

The dependency aiofiles was downgraded from 24.1.0 to 23.2.1 to resolve a compatibility issue with Gradio. No issues were identified with this downgrade in PyRIT.

Tests and Documentation

I am looking for feedback on the types of tests (unit, integration, etc.) and documentation (user guide, API reference, etc.) that should be added for this PR. This scorer is meant as a drop-in replacement for the current HiTL scorer.

@mart123p mart123p changed the title FEAT: Gradio HiTL Scorer [DRAFT] FEAT: Gradio HiTL Scorer Feb 18, 2025
@mart123p mart123p changed the title [DRAFT] FEAT: Gradio HiTL Scorer FEAT: Gradio HiTL Scorer Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant