developer icon indicating copy to clipboard operation
developer copied to clipboard

error in code?

Open iplayfast opened this issue 1 year ago • 2 comments

after editing the main.py to use gtp-3.5 I ran the prompt modal run main.py --prompt "a Chrome extension that, when clicked, opens a small window with a page where you can enter a prompt for reading the currently open page and generating some response from openai"

It came back with AttributeError: 'tuple' object has no attribute 'startswith'

from the lines: ` ...Remote call to Modal Function (ta-VdjFotWssx4N39TvWiMX1a)...

/root/main.py:40 in generate_response

❱ 40 reportTokens(system_prompt)

/root/main.py:30 in reportTokens

❱ 30 encoding = tiktoken.encoding_for_model(openai_model)

/usr/local/lib/python3.10/site-packages/tiktoken/model.py:66 in encoding_for_model

❱ 66 if model_name.startswith(model_prefix): `

iplayfast avatar May 25 '23 15:05 iplayfast

you probably missed removing the "," at the end of the line when switching from gpt-4 to gpt-3.5-turbo

seltar avatar May 25 '23 16:05 seltar

That was it, thank you!

iplayfast avatar May 25 '23 19:05 iplayfast