Repository navigation
Conversation
…e to load_prompt_file reads a probe's prompts.yaml from the folder probe_assets_dir resolves for it, as the probe's bank loaders do: the first root on the asset search path that holds the probe, or the assets_root its class declares. A root on USERSIM_ASSET_PATH that holds other probes' banks does not hide a probe's prompts, and a probe that declares assets_root has its prompts.yaml read from there. A test covers each case. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
Package data includes the files under probes/<label>/assets/ in usersim.engine, and check_dist requires a bank's Markdown there to ship, as it does under engine/assets/. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
A pinned asset root is searched alone. Pinning the packaged directory, as --assets-dir can and as rows stored by a run that named no folder and set no override do, pins the assets that ship with User Sim. For a probe that directory does not hold, probe_assets_dir returns the folder under the root the probe's class declares when that root is inside the package. An extension's root is outside it, so the pin stays strict for an extension. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
The probe module is probes/general_educational/probe.py and its banks are in probes/general_educational/assets/general_educational/, the folder the class names as its assets_root. Its label, prompts, seeds and stored columns are unchanged. Tests that read its seeds or prompts from the packaged directory resolve them through the probe's folder, and the asset discovery tests accept a built-in whose banks are in its own folder inside the package and check that such a built-in names the assets folder beside its module. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
The probe module is probes/general_open_ended/probe.py and its banks are in probes/general_open_ended/assets/general_open_ended/, the folder the class names as its assets_root. Its label, prompts, topics and stored columns are unchanged. The two pipeline tests that read its topics load them through the probe's folder, and fail rather than skip when they are missing. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
Step 2 of the authoring guide has a probe keep its banks beside its code and set assets_root, and the worked bookings example is laid out that way, with probe.py and its banks in assets/bookings/. The probe template is copied to probe.py, the templates that load a bank declare assets_root, and notebook 01 says each probe's assets ship with the package. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
general_open_ended keeps its topics in <locale>/topics.json and general_educational its subjects in <locale>/subjects.json, one folder per locale under each probe's assets, as the other locale-keyed probes lay out their banks. The English file is in en_US/, and load_seeds reads it for a locale that ships no file of its own, such as en_IN and en_SG. The seed files' contents are unchanged. The seed tests build the same layout, and the engine README and notebook 01 name the new paths. Signed-off-by: Yev Meyer <ymeyer@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
general_educationalandgeneral_open_endedeach live in one folder: the probe module issrc/usersim/engine/probes/<label>/probe.py, and its banks are beside it inassets/<label>/, the folder the class names as itsassets_root. That is the layout a probe shipped in its own package already uses, so the same probe can live in either place. Their seeds are one file per locale,<locale>/topics.jsonor<locale>/subjects.json, as the other locale-keyed probes lay out their banks. Labels, prompts, seed contents and stored columns are unchanged.Builds on #117.
load_prompt_fileresolves the probe's folder throughprobe_assets_dir, as the bank loaders do, so a root onUSERSIM_ASSET_PATHthat holds other probes' banks does not hide a probe's prompts, and a probe that declaresassets_roothas itsprompts.yamlread from there.probes/*/assets/**, andscripts/check_dist.pyrequires a bank's Markdown in a probe's folder to ship, as underengine/assets/.--assets-dircan do and whichsimulate --inputsdoes for rows stored by a run that named no folder and set no override, pins the assets that ship with User Sim, so it reaches a probe whose banks are in its own folder inside the package. An extension's root is outside the package, so the pin stays strict for an extension.probe.py, its banks moved,assets_rootset, and the entry inBUILTIN_PROBE_MODULESupdated.test_assets_discovery.pyaccepts a built-in whose banks are in its own folder inside the package, and checks that such a built-in names theassets/folder beside its module.docs/engine/AUTHORING_A_PROBE.mdhas a probe keep its banks beside its code and setassets_root, and the workedbookingsexample is laid out that way. The probe template is copied toprobe.py, and the templates that load a bank declareassets_root.<locale>/topics.jsonor<locale>/subjects.jsonunder its assets, with notopics/orsubjects/level above the locale. The English file is inen_US/, andload_seedsreads it for a locale that ships no file of its own, such asen_INanden_SG. The engine README and notebook 01 name the new paths.How it was verified
At each commit, on that commit's tree:
The test count is 4648, 4651, 4652, 4652, 4652 and 4652 at the second to seventh commits.
At the head:
Each fix's tests fail without it:
The worked
bookingsexample, installed in tree with the guide's files, passesprobe_conformance_problems, runs inen_USandpt_BRwithrun_episode, passesassert_hosted_parity, andusersim smokechecks its assets with the other probes:make health-checkran against a custom provider config for each moved probe, two turns each,general_open_endedinen_SG, which reads theen_UStopics, andgeneral_educationalinko_KR:Every model's requests show
failed=0, the evaluator's included.usersim simulateandusersim eval --scorers autoran against the same config,general_open_endedinen_INandgeneral_educationalinpt_BR. Each stored row's topic or subject is in the file its locale reads, and neither probe declares scorers of its own, so the generic ones ran:Results impact
Conversations, prompts and scores are unchanged. The setup fingerprint of a
simulate --inputsrun hashes the contents of every asset root, so it changes, as after any bank edit, and such a run gives its rows new trajectory ids rather than skipping rows it wrote before this change.