Find answers from the community

Updated 7 months ago

GitHub - princeton-nlp/SWE-agent: SWE-ag...

Hi, I am trying to use CodeSplitter package to split https://github.com/princeton-nlp/SWE-agent but getting this error:L
Plain Text
llm_infra/lib/python3.11/site-packages/llama_index/core/node_parser/text/code.py", line 161, in split_text
    raise ValueError(f"Could not parse code with language {self.language}.")
ValueError: Could not parse code with language python.


any one tried using it?
3
1 comment
i tried doing it for a single python file and got into this erorr:

Plain Text
nodes = CodeHierarchyNodeParser(
                language="python",
                # You can further parameterize the CodeSplitter to split the code
                # into "chunks" that match your context window size using
                # chunck_lines and max_chars parameters, here we just use the defaults
                code_splitter=CodeSplitter(
                    language="python", max_chars=1000, chunk_lines=10
                ),
            ).get_nodes_from_documents(documents)
Add a reply
Sign up and join the conversation on Discord