新增ollama重排类
This commit is contained in:
+12
-1
@@ -88,7 +88,18 @@ class OllamaPlatform(ModelPlatform):
|
||||
pass
|
||||
|
||||
def rerank(self):
|
||||
pass
|
||||
from app.engine.rerank.ollamRerank import OllamaRerank
|
||||
modelpath = os.getcwd() + os.getenv('RERANK_MODEL')
|
||||
top_n = os.getenv('RERANK_TOP_N',5)
|
||||
threshold = float(os.getenv('RERANK_THRESHOLD',0.3))
|
||||
rerank = OllamaRerank(
|
||||
model=modelpath,
|
||||
top_n=top_n,
|
||||
device="cpu",
|
||||
score_threshold= threshold
|
||||
)
|
||||
return [rerank]
|
||||
|
||||
|
||||
@register(ModelPlateCategory,'xinference')
|
||||
class XinferencePlatform(ModelPlatform):
|
||||
|
||||
Reference in New Issue
Block a user