mshumer / gpt-prompt-engineer

MIT License
9.39k stars 642 forks source link

NameError: name 'wandb' is not defined #3

Open ValenteMendez opened 1 year ago

ValenteMendez commented 1 year ago

Hi, very interesting, thanks for sharing! I keep running into the error below

NameError Traceback (most recent call last) in <cell line: 1>() ----> 1 generate_optimal_prompt(description, test_cases, 2, use_wandb)

in generate_optimal_prompt(description, test_cases, number_of_prompts, use_wandb) 119 wandb_table.add_data(prompt, rating) 120 --> 121 wandb.log({"prompt_ratings": wandb_table}) 122 print(table)

NameError: name 'wandb' is not defined

Also, could you clarify how to use the 'test cases'?

mshumer commented 1 year ago

The most recent version might fix the error you're seeing. If not, try adding import wandb at the beginning of your code if you're using Weights & Biases. If you're not, you'll need to remove or comment out the wandb related lines.

Re: the test cases... here is an example of how you'd use it if you want to generate a prompt good for generating marketing headlines:

{
        'prompt': 'A headline introducing a new book on mastering Python programming',
},

or for writing emails:

{
        'prompt': 'Tell Jim I have to leave at 10pm',
},
morganmcg1 commented 1 year ago

@ValenteMendez if you use the notebook in the github itself, not the colab link, you will have the latest colab which should be working.

You could also use this link to directly open the notebook in the github on colab: https://colab.research.google.com/github/mshumer/gpt-prompt-engineer/blob/main/gpt_prompt_engineer.ipynb

Here is a fix to update the colab links in the readme: https://github.com/mshumer/gpt-prompt-engineer/pull/4