openai-cookbook
openai-cookbook copied to clipboard
Update Reproducible_outputs_with_the_seed_parameter.ipynb does not work
Identify the file to be fixed Update Reproducible_outputs_with_the_seed_parameter.ipynb
Describe the problem Downloaded this sample to my Ubuntu OS and run it, got the following output,
python chatgpt.py Output 1
<IPython.core.display.HTML object> Output 2
<IPython.core.display.HTML object> Output 3
<IPython.core.display.HTML object> Output 4
<IPython.core.display.HTML object> Output 5
<IPython.core.display.HTML object> The average similarity between responses is: 0.02543472579143094
didn't get any response messages. Also I have to the modify the code a little bit, see below,
async def main(): responses = await asyncio.gather(*[get_response(i) for i in range(5)]) average_distance = calculate_average_distance(responses) print(f"The average similarity between responses is: {average_distance}")
asyncio.run(main())
otherwise python interpreter will buck at the following python statement,
File "/home/labadmin/openai/chatgpt.py", line 85 responses = await asyncio.gather(*[get_response(i) for i in range(5)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: 'await' outside function
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.