Spaces:
Sleeping
Sleeping
Update private_gpt/components/llm/llm_component.py
Browse files
private_gpt/components/llm/llm_component.py
CHANGED
@@ -21,11 +21,16 @@ class LLMComponent:
|
|
21 |
|
22 |
@inject
|
23 |
def __init__(self, settings: Settings) -> None:
|
24 |
-
llm_mode =
|
25 |
logger.info("Initializing the LLM in mode=%s", llm_mode)
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
match
|
29 |
case "local":
|
30 |
from llama_index.llms import LlamaCPP
|
31 |
prompt_style_cls = get_prompt_style(settings.local.prompt_style)
|
|
|
21 |
|
22 |
@inject
|
23 |
def __init__(self, settings: Settings) -> None:
|
24 |
+
llm_mode = "local"
|
25 |
logger.info("Initializing the LLM in mode=%s", llm_mode)
|
26 |
|
27 |
+
allowed_modes = ["local", "openai", "sagemaker", "mock"]
|
28 |
+
|
29 |
+
if llm_mode not in allowed_modes:
|
30 |
+
raise ValueError(f"Invalid LLM mode: {llm_mode}")
|
31 |
+
|
32 |
|
33 |
+
match llm_mode:
|
34 |
case "local":
|
35 |
from llama_index.llms import LlamaCPP
|
36 |
prompt_style_cls = get_prompt_style(settings.local.prompt_style)
|