fix(ChatData): ChatData (#694)

1.empty table show bug fix;
This commit is contained in:
Aries-ckt
2023-10-19 16:08:57 +08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

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

View File

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