thinkingjimmy / Learning-Prompt

Free prompt engineering online course. ChatGPT and Midjourney tutorials are now included!
https://learningprompt.wiki
Other
5.21k stars 403 forks source link

Got error when running: https://colab.research.google.com/drive/1Fr1hxYOG5lss9vbvZlaw-11wM2U6N7cQ #36

Closed morningman closed 1 year ago

morningman commented 1 year ago

When running construct_index('Jimmy-Newsletter-Corpus'), error reports:

TypeError                                 Traceback (most recent call last)
[<ipython-input-11-92a7906c98e5>](https://localhost:8080/#) in <cell line: 1>()
----> 1 construct_index('Jimmy-Newsletter-Corpus')

2 frames
[<ipython-input-8-039079498604>](https://localhost:8080/#) in construct_index(directory_path)
     21     documents = SimpleDirectoryReader(directory_path).load_data()
     22 
---> 23     index = GPTSimpleVectorIndex(
     24         documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper
     25     )

[/usr/local/lib/python3.9/dist-packages/gpt_index/indices/vector_store/vector_indices.py](https://localhost:8080/#) in __init__(self, nodes, index_struct, service_context, text_qa_template, simple_vector_store_data_dict, **kwargs)
     92         )
     93 
---> 94         super().__init__(
     95             nodes=nodes,
     96             index_struct=index_struct,

[/usr/local/lib/python3.9/dist-packages/gpt_index/indices/vector_store/base.py](https://localhost:8080/#) in __init__(self, nodes, index_struct, service_context, text_qa_template, vector_store, use_async, **kwargs)
     56         self.text_qa_template = text_qa_template or DEFAULT_TEXT_QA_PROMPT
     57         self._use_async = use_async
---> 58         super().__init__(
     59             nodes=nodes,
     60             index_struct=index_struct,

TypeError: __init__() got an unexpected keyword argument 'llm_predictor'

Could you help me with this?

JAdpp commented 1 year ago

same problem...

thinkingjimmy commented 1 year ago

抱歉,这两天在更新 Midjourney 的教程,待我发布完,我来看看这个问题。

lingxide commented 1 year ago

同样遇到这个问题找过来的…… 顺便问一嘴,这个索引一旦建立,本质上是不是通过LlamaIndex库在本地将自己的问题洗一遍再发给GPT?

thinkingjimmy commented 1 year ago

问题已修复,现在可以运行了,是 LLAMA 他们更新了代码: https://github.com/jerryjliu/llama_index/blob/main/docs/guides/primer/usage_pattern.md#customizing-llms

thinkingjimmy commented 1 year ago

同样遇到这个问题找过来的…… 顺便问一嘴,这个索引一旦建立,本质上是不是通过LlamaIndex库在本地将自己的问题洗一遍再发给GPT?

你可以看看这篇文章