fix(python): huggingface TEI auth, procedural-memory content handling, and proxy pip auto-install (#6947)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import os
|
||||
from typing import Literal, Optional
|
||||
|
||||
from openai import OpenAI
|
||||
@@ -17,7 +18,8 @@ class HuggingFaceEmbedding(EmbeddingBase):
|
||||
super().__init__(config)
|
||||
|
||||
if self.config.huggingface_base_url:
|
||||
self.client = OpenAI(base_url=self.config.huggingface_base_url, api_key=self.config.api_key)
|
||||
api_key = self.config.api_key or os.getenv("HUGGINGFACE_API_KEY") or "hf"
|
||||
self.client = OpenAI(base_url=self.config.huggingface_base_url, api_key=api_key)
|
||||
self.config.model = self.config.model or "tei"
|
||||
else:
|
||||
self.config.model = self.config.model or "multi-qa-MiniLM-L6-cos-v1"
|
||||
|
||||
Reference in New Issue
Block a user