瀏覽代碼

make excel parsing configurable (#2517)

### What problem does this PR solve?

#2516

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
tags/v0.12.0
Kevin Hu 1 年之前
父節點
當前提交
78856703c4
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. 4
    1
      rag/app/naive.py
  2. 1
    0
      rag/llm/chat_model.py

+ 4
- 1
rag/app/naive.py 查看文件

@@ -221,7 +221,10 @@ def chunk(filename, binary=None, from_page=0, to_page=100000,
elif re.search(r"\.xlsx?$", filename, re.IGNORECASE):
callback(0.1, "Start to parse.")
excel_parser = ExcelParser()
sections = [(l, "") for l in excel_parser.html(binary) if l]
if parser_config.get("html4excel"):
sections = [(l, "") for l in excel_parser.html(binary, 12) if l]
else:
sections = [(l, "") for l in excel_parser(binary) if l]

elif re.search(r"\.(txt|py|js|java|c|cpp|h|php|go|ts|sh|cs|kt|sql)$", filename, re.IGNORECASE):
callback(0.1, "Start to parse.")

+ 1
- 0
rag/llm/chat_model.py 查看文件

@@ -689,6 +689,7 @@ class BedrockChat(Base):

yield num_tokens_from_string(ans)


class GeminiChat(Base):

def __init__(self, key, model_name,base_url=None):

Loading…
取消
儲存