Skip to content

Instantly share code, notes, and snippets.

@stephenroller
Created June 17, 2020 15:59
Show Gist options
  • Save stephenroller/141a93de5e3f20dfe75ffc3b0a21cac8 to your computer and use it in GitHub Desktop.
Save stephenroller/141a93de5e3f20dfe75ffc3b0a21cac8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# should work after `pip install parlai`
from parlai.core.agents import create_agent
agent = create_agent(
{
'model_file': 'zoo:blender/blender_3B/model', # maps to the parlai downloads url
'datapath': '/tmp/blender', # where we save the downloaded model files
'interactive_mode': True, # don't load the optimizer, turn on beam search
}
)
agent.observe({'text': 'Hi, do you like ramen?', 'episode_done': False})
print(agent.act()['text'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment