Error:
TypeError: expected string or buffer Traceback: File "/home/guoqi/miniconda3/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling result = func() ^^^^^^ File "/home/guoqi/miniconda3/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec exec(code, module.__dict__) File "/home/guoqi/autosurvey_online/main.py", line 202, in <module> login() File "/home/guoqi/autosurvey_online/main.py", line 199, in login main(st.session_state.get("username")) File "/home/guoqi/autosurvey_online/main.py", line 120, in main output = write(topic, 'claude-3-haiku-20240307', 6, 500, 60, True, api_key, api_url, db_path, embedding_model, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/main.py", line 25, in write outline, outline_wo_description = write_outline(topic, model, section_num, 800, db, api_key, api_url, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/main.py", line 37, in write_outline outline = outline_writer.draft_outline(topic, outline_reference_num, 30000, section_num, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/agents/outline_writer.py", line 34, in draft_outline outlines = self.generate_rough_outlines(topic=topic, papers_chunks = abs_chunks, titles_chunks = titles_chunks, section_num=section_num, custom_requirements=custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/agents/outline_writer.py", line 92, in generate_rough_outlines self.output_token_usage += self.token_counter.num_tokens_from_list_string(outlines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/utils.py", line 24, in num_tokens_from_list_string num += len(self.encoding.encode(s)) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/miniconda3/lib/python3.12/site-packages/tiktoken/core.py", line 116, in encode if match := _special_token_regex(disallowed_special).search(text): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error:
TypeError: expected string or buffer Traceback: File "/home/guoqi/miniconda3/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling result = func() ^^^^^^ File "/home/guoqi/miniconda3/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec exec(code, module.__dict__) File "/home/guoqi/autosurvey_online/main.py", line 202, in <module> login() File "/home/guoqi/autosurvey_online/main.py", line 199, in login main(st.session_state.get("username")) File "/home/guoqi/autosurvey_online/main.py", line 120, in main output = write(topic, 'claude-3-haiku-20240307', 6, 500, 60, True, api_key, api_url, db_path, embedding_model, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/main.py", line 25, in write outline, outline_wo_description = write_outline(topic, model, section_num, 800, db, api_key, api_url, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/main.py", line 37, in write_outline outline = outline_writer.draft_outline(topic, outline_reference_num, 30000, section_num, custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/agents/outline_writer.py", line 34, in draft_outline outlines = self.generate_rough_outlines(topic=topic, papers_chunks = abs_chunks, titles_chunks = titles_chunks, section_num=section_num, custom_requirements=custom_requirements) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/agents/outline_writer.py", line 92, in generate_rough_outlines self.output_token_usage += self.token_counter.num_tokens_from_list_string(outlines) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/autosurvey_online/src/utils.py", line 24, in num_tokens_from_list_string num += len(self.encoding.encode(s)) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/guoqi/miniconda3/lib/python3.12/site-packages/tiktoken/core.py", line 116, in encode if match := _special_token_regex(disallowed_special).search(text): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^