facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.48k stars 2.09k forks source link

how to create task with Opt() ? RuntimeError: No task specified. Please select a task with --task {task_name}. #4490

Closed tempdeltavalue closed 2 years ago

tempdeltavalue commented 2 years ago

parser = ParlaiParser() opt = Opt() // opt['task']="some"

// opt = parser.parse_args()

agent = RepeatLabelAgent(opt) world = create_task(opt, agent)

code from docs https://parl.ai/docs/tutorial_basic.html

stephenroller commented 2 years ago

You commented out parse_args?

tempdeltavalue commented 2 years ago

@stephenroller Yes, because I try to run that code in colab (just want to investigate infrastructure)

in other worlds how to pass task in Opt ? What tasks are exist, where I can check that (something like tasks zoo) ? Can I create world in a different way, without task ?

(I just want run code from docs in colab)

tempdeltavalue commented 2 years ago

https://parl.ai/docs/core/worlds.html?highlight=create%20world#parlai.core.worlds.create_task

stanicaa commented 2 years ago

Just had the same problem ... solution is on the same documentation page, but a bit lower. Basically, one needs to initiate a task after initiating the variable opt, something like opt['task']="babi:Task1k:1"

Now, you have to download the necessary files in advance. This is done from the command line (ie no need to be in python), specifying the task that needs to be downloaded. parlai display_data --task babi:task1k:1

Additional detailed explanations @ https://parl.ai/docs/tutorial_basic.html#what-is-parlai , under 'Tasks'