Skip to content

ux: move translator load msg into translator instantiation #1184

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

Merged
merged 9 commits into from
May 22, 2025

Conversation

leondz
Copy link
Collaborator

@leondz leondz commented Apr 25, 2025

Don't show translation loading message when not doing translation
Show message during translation service load, per instance (consistent with other CLI output behaviour)

Verification

  • garak -m test -p test.Test - no globe on CLI
  • garak -m test -p test.Test --config riva_translation.yaml - globe on CLI (for some valid Riva conf doing MT)

@leondz leondz added cli Command-line interface functions ux Interface & interaction improvements labels Apr 25, 2025
@leondz leondz requested a review from jmartin-tech April 25, 2025 12:12
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an appropriate action for a service object instance to take. Also as implemented this would output twice with as the message would be printed for each translation pair required [en-fr, fr-en] for example.

There is already a a logged entry as each translator is created written by langservice.

As it stands harness is the first required entry adding logic in _initialize_runtime_services()to suppress the message if translation will not occur is a more acceptable pattern.

@leondz
Copy link
Collaborator Author

leondz commented Apr 25, 2025

This is not an appropriate action for a service object instance to take.

To address this opinion the code should be consistent, and the CLI UX should remain unaffected, which means coding separation of logic & presentation for CLI. That coding doesn't deliver enough value so I suggest following existing design & practice

Also as implemented this would output twice with as the message would be printed for each translation pair required [en-fr, fr-en] for example.

This is the desired behaviour. We give CLI users information about what they're loading. Alternatives considered but not adopted include:

a. printing an abstract, general message (uninformative - it doesn't describe what is happening in enough granularity)
b. printing only the first message (misleading if there's a crash during the reverse model load)

As it stands harness is the first required entry adding logic in _initialize_runtime_services() to suppress the message if translation will not occur is a more acceptable pattern.

I'm not sure that Harnesses should orchestrate these loads. It feels like scope drift. With the command/cli refactor postponed until we have a solid pattern for calling garak within Python from outside garak (i.e. after another service lands as discussed), I can live with it being here instead of that future orchestration within a command method. Wdyt?

@jmartin-tech jmartin-tech marked this pull request as draft April 25, 2025 22:50
@leondz leondz self-assigned this May 6, 2025
@leondz leondz added this to the 0.11.0 milestone May 8, 2025
@leondz leondz marked this pull request as ready for review May 16, 2025 10:35
@leondz
Copy link
Collaborator Author

leondz commented May 16, 2025

updated pending validation

@leondz leondz requested a review from jmartin-tech May 20, 2025 08:56
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern works for me, a looks like a few unneeded changes and some renamed values need to be accounted for.

Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message printed currently relies on information that is not required in the configuration file.

leondz and others added 4 commits May 22, 2025 07:49
Co-authored-by: Jeffrey Martin <jmartin@Op3n4M3.dev>
Signed-off-by: Leon Derczynski <leonderczynski@gmail.com>
@leondz leondz requested a review from jmartin-tech May 22, 2025 10:39
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks good!

@jmartin-tech jmartin-tech merged commit 25d8186 into NVIDIA:main May 22, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators May 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli Command-line interface functions ux Interface & interaction improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants