I’m trying to write the model() function for exercise 4.
I’m encountering this error. But i cannot understand why this seems to be happening. Here is the error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-23-725c093d6b91> in <module>
----> 1 parameters, last_name = model(data.split("\n"), ix_to_char, char_to_ix, 22001, verbose = True)
2
3 assert last_name == 'Trodonosaurus\n', "Wrong expected output"
4 print("\033[92mAll tests passed!")
<ipython-input-20-c02a61e9c4b1> in model(data_x, ix_to_char, char_to_ix, num_iterations, n_a, dino_names, vocab_size, verbose)
86
87 # Sample indices and print them
---> 88 sampled_indices = sample(parameters, char_to_ix, seed)
89 last_dino_name = get_sample(sampled_indices, ix_to_char)
90 print(last_dino_name.replace('\n', ''))
TypeError: sample() takes from 1 to 2 positional arguments but 3 were given
Though the sample function i created before does accept 3 positional arguments.
The head of the sample() is:
def sample(parameters, char_to_ix, seed):
The test of sample function does gets passed. Still im encountering such error.
I’m sorry i can’t post the code of the sample function.