Web UI
Warning
The components described here are not part of the standard EvalSense API and may change without notice. This part of the documentation is only meant to be used for development purposes.
App
Module evalsense.webui.app
.
Functions:
Name | Description |
---|---|
launch_webui |
Launches the EvalSense Gradio web UI. |
launch_webui
launch_webui(
password: str | None = None,
no_auth: bool = False,
share: bool = False,
port: int = 7860,
)
Launches the EvalSense Gradio web UI.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
password
|
str | None
|
Password for authentication. If None, a random password is generated. |
None
|
no_auth
|
bool
|
If True, disables authentication. |
False
|
share
|
bool
|
If True, enables Gradio public sharing. This will make the app publicly accessible over the internet. Use with caution. |
False
|
port
|
int
|
Port to run the Gradio server on. |
7860
|
Source code in evalsense/webui/app.py
Execution
Module evalsense.webui.execution
.
Functions:
Name | Description |
---|---|
execute_evaluation |
Executes the evaluation based on the current application state. |
execute_meta_evaluation |
Executes a meta-evaluation based on the current application state. |
execute_standard_evaluation |
Executes a standard evaluation for the given application state. |
get_dataset_manager |
Creates and returns a DatasetManager based on the current application state. |
get_evaluators |
Creates and returns a list of Evaluator instances based on the current application state. |
get_model_configs |
Creates and returns a list of ModelConfig based on the current application state. |
execute_evaluation
Executes the evaluation based on the current application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Source code in evalsense/webui/execution.py
execute_meta_evaluation
Executes a meta-evaluation based on the current application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Source code in evalsense/webui/execution.py
execute_standard_evaluation
Executes a standard evaluation for the given application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Source code in evalsense/webui/execution.py
get_dataset_manager
Creates and returns a DatasetManager based on the current application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Returns:
Name | Type | Description |
---|---|---|
DatasetManager |
DatasetManager
|
The instantiated DatasetManager. |
Source code in evalsense/webui/execution.py
get_evaluators
Creates and returns a list of Evaluator instances based on the current application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Returns:
Type | Description |
---|---|
list[Evaluator]
|
list[Evaluator]: The list of instantiated Evaluator objects. |
Source code in evalsense/webui/execution.py
get_model_configs
Creates and returns a list of ModelConfig based on the current application state.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
AppState
|
The current application state. |
required |
Returns:
Type | Description |
---|---|
list[ModelConfig]
|
list[ModelConfig]: The list of instantiated ModelConfig objects. |
Source code in evalsense/webui/execution.py
State
Module evalsense.webui.state
.
Classes:
Name | Description |
---|---|
AppEvaluatorConfig |
Evaluator configuration to be used within the Gradio application. |
AppModelConfig |
Model configuration to be used within the Gradio application. |
AppState |
Application state to be used within the Gradio application. |
Functions:
Name | Description |
---|---|
get_initial_state |
Provides the initial application state. |
AppEvaluatorConfig
Bases: TypedDict
Evaluator configuration to be used within the Gradio application.
Attributes:
Name | Type | Description |
---|---|---|
evaluator_name |
str
|
The name of the evaluator to use. |
evaluator_args |
dict[str, Any]
|
The arguments to pass to the evaluator. |
Source code in evalsense/webui/state.py
AppModelConfig
Bases: TypedDict
Model configuration to be used within the Gradio application.
Attributes:
Name | Type | Description |
---|---|---|
model_name |
str
|
The name of the model to use. |
model_args |
dict[str, Any]
|
The arguments to pass to the model. |
generation_args |
dict[str, Any]
|
The arguments to use for text generation. |
Source code in evalsense/webui/state.py
AppState
Bases: TypedDict
Application state to be used within the Gradio application.
Attributes:
Name | Type | Description |
---|---|---|
dataset_name |
str
|
The name of the dataset to evaluate on. |
dataset_splits |
tuple[str]
|
The used splits of the dataset. |
dataset_version |
str
|
The used version of the dataset. |
input_field_name |
str
|
The name of the main input field in the dataset. |
target_field_name |
str
|
The name of the target field in the dataset. |
choices_field_name |
str
|
The name of the answer choices field in the dataset. |
id_field_name |
str
|
The name of the ID field in the dataset. |
metadata_fields |
tuple[str]
|
The names of the metadata fields in the dataset. |
is_meta_eval |
bool
|
Whether the evaluation to be performed is a meta-evaluation. |
perturbation_tiers |
int
|
The number of perturbation tiers to use for meta-evaluation. |
perturbation_tier_subprompts |
list[str]
|
The subprompts to use for each perturbation tier. |
generation_steps_name |
str
|
The name of the used generation strategy. |
system_prompt |
str
|
The system prompt to use for generation. |
user_prompt |
str
|
The user prompt to use for generation. |
model_configs |
list[AppModelConfig]
|
The model configurations to use for generation. |
evaluator_configs |
list[AppEvaluatorConfig]
|
The evaluator configurations to use for evaluation. |
project_name |
str
|
The name of the evaluation project. |
existing_projects |
list[str]
|
The list of existing evaluation projects. |
Source code in evalsense/webui/state.py
get_initial_state
Provides the initial application state.
Returns:
Name | Type | Description |
---|---|---|
AppState |
AppState
|
The initial application state. |
Source code in evalsense/webui/state.py
Utils
Module evalsense.webui.utils
.
Classes:
Name | Description |
---|---|
ListenerConfig |
Configuration for a textbox listener. |
Functions:
Name | Description |
---|---|
dict_parser |
Parses a string representation of a dictionary into an actual dictionary. |
discover_projects |
Discovers existing evaluation projects in the projects directory. |
empty_is_none_parser_for |
Returns a parser function that returns None for empty strings. |
list_parser |
Parses a comma-separated string into a list of strings. |
setup_listeners |
Sets up listeners updating the application state based on user inputs. |
ListenerConfig
Bases: TypedDict
Configuration for a textbox listener.
Attributes:
Name | Type | Description |
---|---|---|
state_field |
str
|
The name of the state field to update. |
parser |
Callable[[str], Any] | None
|
An optional parser function to process the input value. |
Source code in evalsense/webui/utils.py
dict_parser
Parses a string representation of a dictionary into an actual dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_string
|
str
|
The input string to parse. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: The parsed dictionary. |
Source code in evalsense/webui/utils.py
discover_projects
Discovers existing evaluation projects in the projects directory.
Returns:
Name | Type | Description |
---|---|---|
AppState |
AppState
|
The updated application state with the list of existing projects. |
Source code in evalsense/webui/utils.py
empty_is_none_parser_for
Returns a parser function that returns None for empty strings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
type
|
The type of the value to parse. |
required |
Returns:
Type | Description |
---|---|
Callable[[str], Any | None]
|
Callable[[str], Any | None]: The parser function. |
Source code in evalsense/webui/utils.py
list_parser
Parses a comma-separated string into a list of strings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_string
|
str
|
The input string to parse. |
required |
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list containing the parsed strings. |
Source code in evalsense/webui/utils.py
setup_listeners
Sets up listeners updating the application state based on user inputs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
listener_config
|
dict[GradioInput, TextboxListenerConfig]
|
The configuration specifying the parsers for processing user inputs and the corresponding state fields to update. |
required |
state
|
State
|
The current state of the Gradio application. |
required |