THUDM / ChatGLM3

ChatGLM3 series: Open Bilingual Chat LLMs | 开源双语对话语言模型
Apache License 2.0
13.33k stars 1.55k forks source link

The figure in execute function will be valued as None #1310

Open Stephen-SMJ opened 1 month ago

Stephen-SMJ commented 1 month ago

System Info / 系統信息

Python: 3.11.5

Who can help? / 谁可以帮助到您?

@abmfy

Information / 问题信息

Reproduction / 复现过程

I am referencing the execute method: in line 71 of demo_ci.py. I found when the execution result is a figure, the final variable 'msg_out' will be the code like: {'code': "\n import matplotlib.pyplot as plt\n x = [1, 2, 3, 4, 5]\n y = [2, 3, 5, 7, 6]\n \n plt.plot(x, y)\n \n plt.title('Simple Line Plot')\n plt.xlabel('X-axis')\n plt.ylabel('Y-axis')\n plt.show()\n ", 'execution_count': 1}.

This will lead to: res_type = None, and res = '' in line 199. Is this correct?

Expected behavior / 期待表现

I wonder how you display the figure in your demo