developer
developer copied to clipboard
error in code?
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): `
you probably missed removing the "," at the end of the line when switching from gpt-4 to gpt-3.5-turbo
That was it, thank you!