浏览代码

Fix: typo Bearer token (#8998)

### What problem does this PR solve?

Typo Bearer token. #8960

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.20.0
Yongteng Lei 3 个月前
父节点
当前提交
a2f73af1a4
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1
    1
      rag/llm/embedding_model.py
  2. 1
    1
      rag/llm/tts_model.py

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

@@ -283,7 +283,7 @@ class OllamaEmbed(Base):
_special_tokens = ["<|endoftext|>"]

def __init__(self, key, model_name, **kwargs):
self.client = Client(host=kwargs["base_url"]) if not key or key == "x" else Client(host=kwargs["base_url"], headers={"Authorization": f"Bear {key}"})
self.client = Client(host=kwargs["base_url"]) if not key or key == "x" else Client(host=kwargs["base_url"], headers={"Authorization": f"Bearer {key}"})
self.model_name = model_name

def encode(self, texts: list):

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

@@ -314,7 +314,7 @@ class OllamaTTS(Base):
self.base_url = base_url
self.headers = {"Content-Type": "application/json"}
if key and key != "x":
self.headers["Authorization"] = f"Bear {key}"
self.headers["Authorization"] = f"Bearer {key}"

def tts(self, text, voice="standard-voice"):
payload = {"model": self.model_name, "voice": voice, "input": text}

正在加载...
取消
保存