-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
System Info
2.0.44, the same database ,the same question , langchain cost 7s, vanna cost 8s(2s for plot), i test 48 hours to check why pandasai so slow , find that ,all by the generate_python_code.tmpl and generate_python_code_with_sql.tmpl.
Why use a huge prompt instead of separating it and use different prompts for different stages. To make a large model, reduce the amount of reading and thinking each time, which can save a lot of time and tokens.
🐛 Describe the bug
2024-05-30 00:50:25,773 - logger.py[line:75] - INFO: Persisting Agent Training data in E:\LANGCHAT\Langchain-Chatchat\chromadb
2024-05-30 00:50:25,810 - segment.py[line:189] - INFO: Collection pandasai-qa is not created.
2024-05-30 00:50:25,811 - segment.py[line:189] - INFO: Collection pandasai-docs is not created.
2024-05-30 00:50:25,811 - logger.py[line:75] - INFO: Successfully initialized collection pandasai
2024-05-30 00:50:26,037 - logger.py[line:75] - INFO: Question: 列出12号楼所有电表中度数最高的前5个,生成图表
2024-05-30 00:50:26,037 - logger.py[line:75] - INFO: Running PandasAI with langchain_tongyi LLM...
2024-05-30 00:50:26,037 - logger.py[line:75] - INFO: Prompt ID: c2c97c1c-fc13-4fd8-87d1-a5f647ce100f
2024-05-30 00:50:26,038 - logger.py[line:75] - INFO: Executing Pipeline: GenerateChatPipeline
2024-05-30 00:50:28,044 - logger.py[line:75] - INFO: Executing Step 0: ValidatePipelineInput
2024-05-30 00:50:28,045 - logger.py[line:75] - INFO: Executing Step 1: CacheLookup
2024-05-30 00:50:28,045 - logger.py[line:75] - INFO: Executing Step 2: PromptGeneration
2024-05-30 00:50:30,261 - logger.py[line:75] - INFO: Executing Step 3: CodeGenerator
2024-05-30 00:50:45,749 - logger.py[line:75] - INFO: Executing Step 4: CachePopulation
2024-05-30 00:50:45,750 - logger.py[line:75] - INFO: Executing Step 5: CodeCleaning
2024-05-30 00:50:45,750 - logger.py[line:75] - INFO: Saving charts to exports\charts\c2c97c1c-fc13-4fd8-87d1-a5f647ce100f.png
2024-05-30 00:50:45,752 - logger.py[line:75] - INFO: