amaze18 / LeDoux

MIT License
0 stars 0 forks source link

Add model="gpt-4o" as primary model #4

Closed amaze18 closed 5 months ago

amaze18 commented 5 months ago

m=["gpt-4-1106-preview","gpt-4-0125-preview"]

add llm= OpenAI(model="gpt-4o") as well in the used model..it has better performance

amaze18 commented 5 months ago

added "gpt-4o" the model sir

amaze18 commented 5 months ago

is gpt-4o working @SaiGane5 ??

SaiGane5 commented 5 months ago

No sir (@amaze18), tried openai library it has gpt-4o but didn't work as we cannot pass temperature argument with openai library, llama_index is working but it doesn't have gpt-4o

SaiGane5 commented 5 months ago

Done sir, updated the earlier OpenAI with "from llama_index.llms.openai import OpenAI", and In this we don't have temperature argument, so removed it, now it's working

amaze18 commented 5 months ago

Traceback:

File "/home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script exec(code, module.dict) File "/mount/src/ledoux/streamlit_app.py", line 141, in chat_history=st.session_state.message_history).chat(str(prompt)) ^^^^^^^^^^^^^^^^^ File "/home/adminuser/venv/lib/python3.11/site-packages/llama_index/legacy/callbacks/utils.py", line 41, in wrapper return func(self, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/adminuser/venv/lib/python3.11/site-packages/llama_index/legacy/chat_engine/condense_plus_context.py", line 278, in chat chat_messages, context_source, context_nodes = self._run_c3( ^^^^^^^^^^^^^ File "/home/adminuser/venv/lib/python3.11/site-packages/llama_index/legacy/chat_engine/condense_plus_context.py", line 222, in _run_c3 self._memory.get(initial_token_count=initial_token_count), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/adminuser/venv/lib/python3.11/site-packages/llama_index/legacy/memory/chat_memory_buffer.py", line 110, in get raise ValueError("Initial token count exceeds token limit")

SaiGane5 commented 5 months ago

We will clear the message history for every 4 messages. So that the token size limit won't exceed. Or we will shift this entire thing to an EC2. With these two solutions I am closing this issue