Snowflake LLM - IndexError: list index out of range

Hi,
I am trying to replicate the Frosty app on my local PC using Streamlit.
https://quickstarts.snowflake.com/guide/frosty_llm_chatbot_on_streamlit_snowflake/index.html#5

However, when I run the Python script, I get below error:

File “C:\Users.…\AppData\Local\Programs\Python\Python311\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py”, line 534, in _run_script
exec(code, module.dict)
File “C:.…\commgpt_app.py”, line 58, in
response += delta.choices[0].delta.get(“content”, “”)
IndexError: list index out of range

What could be the reason?

You can refer the code:
https://drive.google.com/drive/folders/1y4qMtb3kwAOv1beAgmkHLsAwXKg9f7Hb?usp=sharing

Regards
VR

Hi @ramani-venkat,

We’re in the process of updating that quickstart given the recent OpenAI changes – for now, you can either use openai version < 1.0.0 or use the updated code for versions 1.0.0 and up that’s available here.

1 Like

Thanks for flagging the issue! We have a PR out to update a similar tutorial in the Streamlit documentation as well.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.