Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwiktrammer committed Jan 9, 2025
1 parent 66c3f07 commit 607bab3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/ragbits-core/src/ragbits/core/prompt/promptfoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ def generate_configs(
target_path.mkdir()
for prompt in prompts:
with open(target_path / f"{prompt.__qualname__}.yaml", "w", encoding="utf-8") as f:
prompt_path = f'file://{prompt.__module__.replace(".", os.sep)}.py:{prompt.__qualname__}.to_promptfoo'
prompt_path = f"file://{prompt.__module__.replace('.', os.sep)}.py:{prompt.__qualname__}.to_promptfoo"
yaml.dump({"prompts": [prompt_path]}, f)
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _decompose_key(key: str) -> tuple[str | int | None, str | int | None]:
_current_subkey = int(_key[start_subscript_index:end_subscript_index])

if len(_key[end_subscript_index:]) > 1:
_current_subkey = f"{_current_subkey}.{_key[end_subscript_index + 2:]}"
_current_subkey = f"{_current_subkey}.{_key[end_subscript_index + 2 :]}"
break
elif char == ".":
split_work = _key.split(".", 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BasicAnswerGenPrompt(Prompt[BasicAnswerGenInput, str]):
"If you don't know the answer just say: I don't know."
)

user_prompt: str = "Text:\n<|text_start|>\n {{ chunk }} \n<|text_end|>\n\nQuestion:\n " "{{ question }} \n\nAnswer:"
user_prompt: str = "Text:\n<|text_start|>\n {{ chunk }} \n<|text_end|>\n\nQuestion:\n {{ question }} \n\nAnswer:"


class PassagesGenInput(BaseModel):
Expand All @@ -49,9 +49,7 @@ class PassagesGenPrompt(Prompt[PassagesGenInput, str]):
"FULL SENTENCES"
)

user_prompt: str = (
"Question:\n {{ question }} \nAnswer:\n {{ basic_answer }} \nChunk:\n " "{{ chunk }}\n\nPassages:"
)
user_prompt: str = "Question:\n {{ question }} \nAnswer:\n {{ basic_answer }} \nChunk:\n {{ chunk }}\n\nPassages:"


class QueryGenInput(BaseModel):
Expand Down

0 comments on commit 607bab3

Please sign in to comment.