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

chore(precommit): add uv-sync hook #278

Open
wants to merge 3 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ repos:
hooks:
- id: uv-export
args: ["--frozen", "--no-hashes", "--no-emit-project"]
- id: uv-sync
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while you are at it, can you update the args above to add --output-file=requirements.txt


# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.14.0
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Meta has a [bounty program](http://facebook.com/whitehat/info) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.

## Coding Style
## Coding Style
* 2 spaces for indentation rather than tabs
* 80 character line length
* 120 character line length
* ...

## License
Expand Down
12 changes: 3 additions & 9 deletions models/llama3/prompt_templates/system_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,23 +223,17 @@ class PythonListCustomToolGenerator(PromptTemplateGeneratorBase): # noqa: N801
also point it out. You should only return the function call in tools call sections.

{{ function_description }}
""".strip(
"\n"
)
""".strip("\n")
)

def gen(
self, custom_tools: List[ToolDefinition], system_prompt: Optional[str] = None
) -> PromptTemplate:
def gen(self, custom_tools: List[ToolDefinition], system_prompt: Optional[str] = None) -> PromptTemplate:
system_prompt = system_prompt or self.DEFAULT_PROMPT
return PromptTemplate(
system_prompt,
{"function_description": self._gen_function_description(custom_tools)},
)

def _gen_function_description(
self, custom_tools: List[ToolDefinition]
) -> PromptTemplate:
def _gen_function_description(self, custom_tools: List[ToolDefinition]) -> PromptTemplate:
template_str = textwrap.dedent(
"""
If you decide to invoke any of the function(s), you MUST put it in the format of [func_name1(params_name1=params_value1, params_name2=params_value2...), func_name2(params)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_llama_3_2_provided_system_prompt(self):
user_system_prompt = textwrap.dedent(
"""
Overriding message.

{{ function_description }}
"""
)
Expand Down