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

More prompt format #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1,680 changes: 928 additions & 752 deletions poetry.lock

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions private_gpt/components/llm/llm_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from llama_index.llms import MockLLM
from llama_index.llms.base import LLM

from private_gpt.components.llm.prompt_helper import get_prompt_style
from private_gpt.paths import models_path
from private_gpt.settings.settings import Settings

Expand All @@ -23,9 +22,14 @@ def __init__(self, settings: Settings) -> None:
case "local":
from llama_index.llms import LlamaCPP

prompt_style_cls = get_prompt_style(settings.local.prompt_style)
prompt_style = prompt_style_cls(
default_system_prompt=settings.local.default_system_prompt
from private_gpt.components.llm.prompt.prompt_helper import (
get_prompt_style,
)

prompt_style = get_prompt_style(
prompt_style=settings.local.prompt_style,
template_name=settings.local.template_name,
default_system_prompt=settings.local.default_system_prompt,
)

self.llm = LlamaCPP(
Expand All @@ -43,6 +47,7 @@ def __init__(self, settings: Settings) -> None:
completion_to_prompt=prompt_style.completion_to_prompt,
verbose=True,
)
# prompt_style.improve_prompt_format(llm=cast(LlamaCPP, self.llm))

case "sagemaker":
from private_gpt.components.llm.custom.sagemaker import SagemakerLLM
Expand Down
Empty file.