ngruver / llmtime

https://arxiv.org/abs/2310.07820
MIT License
628 stars 139 forks source link

Question about the generate_predictions() function #19

Open NimeeshaChan opened 6 months ago

NimeeshaChan commented 6 months ago

When I run the demo.ipynb file without changing anything and try getting the autotuned predictions, gpt3 works fine, but once I use gpt4 and the promptcast model, I get this error:


TypeError Traceback (most recent call last) Cell In[9], line 6 4 hypers = list(grid_iter(model_hypers[model])) 5 num_samples = 2 ----> 6 pred_dict = get_autotuned_predictions_data(train, test, hypers, num_samples, model_predict_fns[model], verbose=False, parallel=False) 7 out[model] = pred_dict 8 plot_preds(train, test, pred_dict, model, show_samples=True)

File /mnt/aamv_data/nimeesha_workspace/nimeesha_workspace/first_paper/AAMV/llmtime/models/validation_likelihood_tuning.py:119, in get_autotuned_predictions_data(train, test, hypers, num_samples, get_predictions_fn, verbose, parallel, n_train, n_val) 117 best_val_nll = float('inf') 118 print(f'Sampling with best hyper... {best_hyper} \n with NLL {best_val_nll:3f}') --> 119 out = get_predictions_fn(train, test, **best_hyper, num_samples=num_samples, n_train=n_train, parallel=parallel) 120 out['best_hyper']=convert_to_dict(best_hyper) 121 return out

File /mnt/aamv_data/nimeesha_workspace/nimeesha_workspace/first_paper/AAMV/llmtime/models/promptcast.py:278, in get_promptcast_predictions_data(train, test, model, settings, num_samples, temp, dataset_name, kwargs) 275 input_strs = None 276 if num_samples > 0: 277 # Generate predictions --> 278 preds, completions_list, input_strs = generate_predictions(model, inputs, steps, settings, scalers, 279 num_samples=num_samples, temp=temp, prompts=prompts, post_prompts=post_prompts, 280 parallel=True, return_input_strs=True, constrain_tokens=False, strict_handling=True, kwargs) 281 # skip bad samples 282 samples = [pd.DataFrame(np.array([p for p in preds[i] if p is not None]), columns=test[i].index) for i in range(len(preds))]

TypeError: models.promptcast.generate_predictions() got multiple values for keyword argument 'parallel'

Changing parallel=False to True, or removing the parameter in the function call altogether doesn't work. What should I do?

Thank you!

nickreich commented 6 months ago

I received the same error.