-
-
Save ninehills/ecf7107574c83016e8b68965bf9a51c4 to your computer and use it in GitHub Desktop.
LICENSE: MIT
COOOOL,有没有一个问题平均需要token的估计?
COOOOL,有没有一个问题平均需要token的估计?
这个要和你使用的参数来定,我更新了一个版本,可以计算每次计算消耗的 Token。
针对如下参数:
response_mode="tree_summarize",
similarity_top_k=3,
mode="embedding",
的情况下,每次问题估计消耗 10000 token,也就是相当于 $0.02 = 0.14 元人民币。
如果将 similarity_top_k 改成默认值 1,那么价格将会降低为原来的 1/3。
I did not know what to do, would u please help me with these error?
TypeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 resp = chat("这本书讲了什么?")
2 display_response(resp)
7 frames
/usr/local/lib/python3.9/dist-packages/llama_index/indices/vector_store/base_query.py in init(self, index_struct, service_context, vector_store, similarity_top_k, **kwargs)
35 ) -> None:
36 """Initialize params."""
---> 37 super().init(
38 index_struct=index_struct, service_context=service_context, **kwargs
39 )
TypeError: init() got an unexpected keyword argument 'llm_predictor'
llama_index 0.5 have API broken!!!
so you can use pip install llama_index==0.4.40
.
I did not know what to do, would u please help me with these error?
TypeError: init() got an unexpected keyword argument 'llm_predictor'
提示语改成如下会避免错误的杜撰:(参考 mayooear/gpt4-pdf-chatbot-langchain 项目)