aorwall / moatless-tools

MIT License
223 stars 21 forks source link

Getting `0/0` for "Generating Embeddings" step #33

Open john-b-yang opened 6 days ago

john-b-yang commented 6 days ago

Thanks for all the really inspiring work on SWE-bench + programming agents 😄

I had a quick question. I'm trying to run the 00_index_and_run.ipynb notebook. I'm attempting to run flask through the repository.

I've done the following steps:

  1. Cloned pallets/flask locally
  2. Set my OPENAI_API_KEY in a .env file located within notebooks/
  3. Run the below code from the notebook:
    
    import tree_sitter_python as tspython
    from tree_sitter import Language, Parser
    from moatless.index import CodeIndex, IndexSettings
    from moatless import FileRepository, Workspace

An OPENAI_API_KEY is required to use the OpenAI Models

model = "gpt-4o-2024-05-13" index_settings = IndexSettings( embed_model="text-embedding-3-small" )

repo_dir = "/absolute/path/to/flask" file_repo = FileRepository(repo_path=repo_dir)

code_index = CodeIndex(file_repo=file_repo, settings=index_settings) nodes, tokens = code_index.run_ingestion() print(f"Indexed {nodes} nodes and {tokens} tokens")



When I run these steps, I'm getting:
![Screenshot 2024-09-12 at 7 39 48 PM](https://github.com/user-attachments/assets/3751a3f0-e2e8-4105-a94f-523834e3b380)

It looks like no embeddings were generated, and I'm not quite sure where I went wrong here.

Thanks in advance!
aorwall commented 5 days ago

Weird. I tried to reproduce but could generate embeddings. Can you enable logging with logging.basicConfig(level=logging.INFO) and provide the logs?

image