mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-05-31 11:16:00 +00:00
Add timeout parameter for better support of openailike LLM tools on local computer (like LM Studio). (#1858)
feat(llm): Improve settings of the OpenAILike LLM
This commit is contained in:
parent
966af4771d
commit
45df99feb7
@ -123,6 +123,9 @@ class LLMComponent:
|
|||||||
max_new_tokens=settings.llm.max_new_tokens,
|
max_new_tokens=settings.llm.max_new_tokens,
|
||||||
messages_to_prompt=prompt_style.messages_to_prompt,
|
messages_to_prompt=prompt_style.messages_to_prompt,
|
||||||
completion_to_prompt=prompt_style.completion_to_prompt,
|
completion_to_prompt=prompt_style.completion_to_prompt,
|
||||||
|
tokenizer=settings.llm.tokenizer,
|
||||||
|
timeout=openai_settings.request_timeout,
|
||||||
|
reuse_client=False,
|
||||||
)
|
)
|
||||||
case "ollama":
|
case "ollama":
|
||||||
try:
|
try:
|
||||||
|
@ -205,6 +205,10 @@ class OpenAISettings(BaseModel):
|
|||||||
"gpt-3.5-turbo",
|
"gpt-3.5-turbo",
|
||||||
description="OpenAI Model to use. Example: 'gpt-4'.",
|
description="OpenAI Model to use. Example: 'gpt-4'.",
|
||||||
)
|
)
|
||||||
|
request_timeout: float = Field(
|
||||||
|
120.0,
|
||||||
|
description="Time elapsed until openailike server times out the request. Default is 120s. Format is float. ",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class OllamaSettings(BaseModel):
|
class OllamaSettings(BaseModel):
|
||||||
|
@ -3,6 +3,9 @@ server:
|
|||||||
|
|
||||||
llm:
|
llm:
|
||||||
mode: openailike
|
mode: openailike
|
||||||
|
max_new_tokens: 512
|
||||||
|
tokenizer: mistralai/Mistral-7B-Instruct-v0.2
|
||||||
|
temperature: 0.1
|
||||||
|
|
||||||
embedding:
|
embedding:
|
||||||
mode: huggingface
|
mode: huggingface
|
||||||
@ -15,3 +18,4 @@ openai:
|
|||||||
api_base: http://localhost:8000/v1
|
api_base: http://localhost:8000/v1
|
||||||
api_key: EMPTY
|
api_key: EMPTY
|
||||||
model: facebook/opt-125m
|
model: facebook/opt-125m
|
||||||
|
request_timeout: 600.0
|
Loading…
Reference in New Issue
Block a user