Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Agents] Create agent from model file #2826

Merged
merged 4 commits into from
Jul 10, 2020
Merged

[Agents] Create agent from model file #2826

merged 4 commits into from
Jul 10, 2020

Conversation

emilydinan
Copy link
Contributor

@emilydinan emilydinan commented Jul 9, 2020

Patch description
Make it easier to create an agent from model file. Before, we did not add a datapath or model_subargs which could make loading or overriding opts difficult. Also cleaned up the create_agent_from_opt_file function (renaming a few things and moving some stuff around). It's still a bit of a mess though TBH.

Now you can do something like:
agent = create_agent_from_model_file('zoo:blender/blender_90M/model', {'inference': 'topk'}) and it will automatically create the agent with all of the correct arguments added and override the inference to topk.

This will be useful for M-Turk and other tasks where we have to create "subagents" (like retrieve and refine). It is also incidentally useful for #2803 in which @dianaglzrico needs to create a partner_agent for two models to speak to each other.

Emily Dinan added 2 commits July 9, 2020 06:51
@emilydinan
Copy link
Contributor Author

I do not know what this mypy error is

@emilydinan emilydinan requested a review from mwillwork July 9, 2020 17:51
Copy link
Contributor

@klshuster klshuster left a comment

Choose a reason for hiding this comment

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

i think this all looks good, just a few questions

also mypy is failing everywhere (something about installing a dependency), so dw about it

parlai/core/agents.py Show resolved Hide resolved
parlai/core/agents.py Show resolved Hide resolved
parlai/core/agents.py Show resolved Hide resolved
@emilydinan emilydinan merged commit 3e8320d into master Jul 10, 2020
@emilydinan emilydinan deleted the modelfromfilefix branch July 10, 2020 20:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants