Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set ollama keep_alive #985

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/db/init_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,8 @@ def init_llm_factory():
{
"fid": factory_infos[12]["name"],
"llm_name": "BAAI/bge-reranker-v2-m3",
"tags": "LLM,CHAT,",
"max_tokens": 16385,
"tags": "RE-RANK,2k",
"max_tokens": 2048,
"model_type": LLMType.RERANK.value
},
]
Expand Down
6 changes: 4 additions & 2 deletions rag/llm/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def chat(self, system, history, gen_conf):
response = self.client.chat(
model=self.model_name,
messages=history,
options=options
options=options,
keep_alive=-1
)
ans = response["message"]["content"].strip()
return ans, response["eval_count"] + response.get("prompt_eval_count", 0)
Expand All @@ -325,7 +326,8 @@ def chat_streamly(self, system, history, gen_conf):
model=self.model_name,
messages=history,
stream=True,
options=options
options=options,
keep_alive=-1
)
for resp in response:
if resp["done"]:
Expand Down