openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

Update Reproducible_outputs_with_the_seed_parameter.ipynb does not work

Open dechingit opened this issue 1 year ago • 1 comments
trafficstars

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

dechingit avatar Mar 04 '24 18:03 dechingit

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.

github-actions[bot] avatar May 04 '24 01:05 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar May 14 '24 01:05 github-actions[bot]