Procházet zdrojové kódy

Fix: Bedrock model invocation error. (#6533)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.18.0
Kevin Hu před 7 měsíci
rodič
revize
12ad746ee6
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2
    2
      rag/llm/chat_model.py

+ 2
- 2
rag/llm/chat_model.py Zobrazit soubor

def chat(self, system, history, gen_conf): def chat(self, system, history, gen_conf):
from botocore.exceptions import ClientError from botocore.exceptions import ClientError
for k in list(gen_conf.keys()): for k in list(gen_conf.keys()):
if k not in ["top_p", "max_tokens"]:
if k not in ["temperature"]:
del gen_conf[k] del gen_conf[k]
for item in history: for item in history:
if not isinstance(item["content"], list) and not isinstance(item["content"], tuple): if not isinstance(item["content"], list) and not isinstance(item["content"], tuple):
def chat_streamly(self, system, history, gen_conf): def chat_streamly(self, system, history, gen_conf):
from botocore.exceptions import ClientError from botocore.exceptions import ClientError
for k in list(gen_conf.keys()): for k in list(gen_conf.keys()):
if k not in ["top_p", "max_tokens"]:
if k not in ["temperature"]:
del gen_conf[k] del gen_conf[k]
for item in history: for item in history:
if not isinstance(item["content"], list) and not isinstance(item["content"], tuple): if not isinstance(item["content"], list) and not isinstance(item["content"], tuple):

Načítá se…
Zrušit
Uložit