bugfix(ChatData): ChatData

1.empty table show bug fix;
This commit is contained in:
yhjun1026
2023-10-19 16:05:59 +08:00
parent a833e8b045
commit 365eb0f9ed
2 changed files with 3 additions and 3 deletions

View File

@@ -36,8 +36,8 @@ class DbChatOutputParser(BaseOutputParser):
### tool out data to table view ### tool out data to table view
data_loader = DbDataLoader() data_loader = DbDataLoader()
if len(data) <= 1: if len(data) < 1:
data.insert(0, ["result"]) data.insert(0, [])
df = pd.DataFrame(data[1:], columns=data[0]) df = pd.DataFrame(data[1:], columns=data[0])
if not CFG.NEW_SERVER_MODE and not CFG.SERVER_LIGHT_MODE: if not CFG.NEW_SERVER_MODE and not CFG.SERVER_LIGHT_MODE:
table_style = """<style> table_style = """<style>

View File

@@ -3,7 +3,7 @@ class DbDataLoader:
import pandas as pd import pandas as pd
### tool out data to table view ### tool out data to table view
if len(data) <= 1: if len(data) < 1:
data.insert(0, ["result"]) data.insert(0, ["result"])
df = pd.DataFrame(data[1:], columns=data[0]) df = pd.DataFrame(data[1:], columns=data[0])
html_table = df.to_html(index=False, escape=False, sparsify=False) html_table = df.to_html(index=False, escape=False, sparsify=False)