Closed jonty-esterhuizen closed 10 months ago
🤖
Hello,
The error you're encountering is likely due to the map_prompt
argument in the load_summarize_chain
function. The map_prompt
argument should be an instance of PromptTemplate
, but in your code, it seems like you're passing a string (objective
).
Here's how you can fix it:
map_prompt_template = PromptTemplate(
template=mapPrompt, input_variables=["text", "objective"]
)
chain = load_summarize_chain(llm=my_gpt_instance,
chain_type="map_reduce",
verbose=True,
map_prompt=map_prompt_template,
combine_prompt=map_prompt_template)
In the above code, I've replaced map_prompt=objective
with map_prompt=map_prompt_template
.
As for your question about using a different language model as a base instead of GPT, the LangChain framework is designed to work with any language model that is compatible with its interfaces. You can use any language model that is an instance of BaseLanguageModel
. In your case, you have correctly created a custom LLM class MyGPT4ALL
that extends LLM
.
However, please note that the _call
method in your MyGPT4ALL
class currently returns a hardcoded string "initiolized". This method should be implemented to call your custom language model and return the generated text.
I hope this helps! Let me know if you have any other questions.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Issue you'd like to raise.
when i try and run this script
i get this issue Exception has occurred: ValidationError 1 validation error for LLMChain prompt value is not a valid dict (type=type_error.dict) File "E:\StormboxBrain\langchain\websiteSummary.py", line 27, in _SummorizeWebsite chain = load_summarize_chain(llm=my_gpt_instance, File "E:\StormboxBrain\langchain\app.py", line 12, in
summary = websiteSummary._SummorizeWebsite(objective, data)
pydantic.error_wrappers.ValidationError: 1 validation error for LLMChain
my model does load and can create prompt responses mistral-7b-openorca.Q4_0.gguf
this is mygpt4all class
Suggestion:
is there any documentation on how to use another llm as base and not gpt