Giter Club home page Giter Club logo

Comments (4)

wiio12 avatar wiio12 commented on September 2, 2024 1

Hi @luan-xiaokun, what you have done is correct, and there are two ways of making this work:

  1. As you said, you need to craft a skill.json file, with some basic skills. following the format of the existing skills.json file. I am not sure if only doing this will eliminate all the errors since other things in the skill library are not initialized.

  2. A simpler way I can think of is this: since you only want to change the problem to solve with LEGO-Prover, you can only replace the valid_problem_vectordb in data/initialize_skills/skill with valid_problem_vectordb you have crafted in my_checkpoints. This way you won't need to craft the skills.json file.

I might provide a script to craft the initial skill library (hopefully by the end of this week).

from lego-prover.

wiio12 avatar wiio12 commented on September 2, 2024

Hi @luan-xiaokun, thank you for your attention to our work! Indeed all the vector stores are pre-initialized and stored in the data/initialize_skills/skill directory. To customize the initial skill library, you may check the code in lego_prover/env/chroma_worker.py.

Here is a simple example:

chroma_worker = ChromaWorker("path/to/save/library", resume=False)  # set resume equals False will initialize a empty library
data = "Your new problem statement"
error, output = chroma_worker.valid_problem_add_text(data)

After the vector store is built, you may replace the ../../data/initialize_skills/skill in line 40 with your own path/to/save/library

from lego-prover.

luan-xiaokun avatar luan-xiaokun commented on September 2, 2024

Hi @wiio12, thanks for your help! I followed your instructions, here is what I did and what I found:

  1. I commented out line 40 in lego_prover/env/chroma_worker.py to ensure that we are building an empty skill library from scratch
    class ChromaWorker:
    def __init__(self, ckpt_dir, resume=False) -> None:
    # copy the initial skill
    if not resume:
    print(f"Initializing skills")
    U.f_copytree("../../data/initialize_skills/skill", f"../../{ckpt_dir}/skill", exist_ok=True)
  2. I followed your instruction and changed the script in lego_prover/env/chroma_worker.py to the following, where true_skill.json only contains a trivial fact that True holds.
if __name__ == "__main__":
    ckpt_path = "my_checkpoints"
    resume = False
    chroma_worker = ChromaWorker(ckpt_path, resume)
    print("Chroma worker is ready.")
    with open("../../my_checkpoints/true_skill.json") as json_file:
        action, data = json.load(json_file)
        assert action == "problem_add_text"
    error, output = chroma_worker.valid_problem_add_text(data)
    print("error:", error)
    print("output:", output)
  1. Next, I ran the script and obtained a new (almost empty) skill library in my_checkpoints.
  2. Finally, I restored the original script, and changed the path on line 40 in lego_prover/env/chroma_worker.py to my checkpoints folder, so that the Chroma worker will use my custom skill library when proving things.

After that, I found that my custom skill library located in my_checkpoints/skill does not have a skills.json file, resulting in an index out of range error in the evolver process (skill_manager.skills is an empty dictionary since I don't have a skills.json file in my_checkpoints/skill) LEGO seems to be working despite the error, but I'm not sure if the Chroma worker is still working.

def evolve(self):
while True:
with self.skill_manager_lock:
self.skill_manager.sync_checkpoint()
skill_list = sorted(self.skill_manager.skills.values(), key=lambda x: x["update_count"])
smallest_skill_update_count = skill_list[0]["update_count"]

If I copy the skills.json file in data/initialize_skills/skill to my skill library, it will complain that vectordb is not synced with skill.json, so it seems like that to create my own custom skill library, I still need to craft a skills.json file, correct?

from lego-prover.

luan-xiaokun avatar luan-xiaokun commented on September 2, 2024

Thanks for your quick response @wiio12! Looking forward to your skill lib initialization script!

from lego-prover.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.