kyegomez / tree-of-thoughts

Plug in and Play Implementation of Tree of Thoughts: Deliberate Problem Solving with Large Language Models that Elevates Model Reasoning by atleast 70%
https://discord.gg/qUtxnK2NMf
Apache License 2.0
4.16k stars 350 forks source link

gpt4all integration #62

Closed ProxyAyush closed 1 year ago

ProxyAyush commented 1 year ago

so I use gpt4all which gets imported as from langchain.llms import GPT4All

I want to know if I can import from TOT as from tree_of_thoughts import GPT4ALL

as i use models from GPT4ALL pipeline

williamchai commented 1 year ago

You could rename the package: “from … import ABC as ABC_1”

kyegomez commented 1 year ago

Hey @ProxyAyush can you explain deeper?

If you want you can use GPT4ALL by defining an custom abstract language class that adheres to the following guidelines:

class CustomLanguageModel(AbstractLanguageModel):
    def __init__(self, model):
        self.model = model

    def generate_thoughts(self, state, k):
        #implement the thought generation logic using self.model
        pass

    def evaluate_states(self, states):
        #implement state evaluation logic using self.model
        pass