-
Notifications
You must be signed in to change notification settings - Fork 40
[update] support for qwen3-4b #86
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
base: main
Are you sure you want to change the base?
Changes from all commits
795c156
33e1251
b3f4492
c445ff1
bc26dea
45bfb7b
42da60c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,13 +43,15 @@ def __getitem__(self, index): | |
| target_mask = [0] * len(input_ids) | ||
|
|
||
| # setting tool information | ||
| if "tools" in data.keys() and data["tools"]: | ||
| if "tools" in data.keys(): | ||
| tools = json.loads(data["tools"]) | ||
| tool_prompt = tool_formater(tools) | ||
| tool_text = self.tool_format.format(content=tool_prompt) | ||
| tool_tokens = self.tokenizer.encode(tool_text, add_special_tokens=False) | ||
| input_ids = input_ids + tool_tokens | ||
| target_mask = target_mask + [0] * len(tool_tokens) | ||
| if tools: | ||
| # tool_prompt = tool_formater(tools) | ||
| tool_prompt = json.dumps(tools) | ||
| tool_text = self.tool_format.format(content=tool_prompt) | ||
| tool_tokens = self.tokenizer.encode(tool_text, add_special_tokens=False) | ||
| input_ids = input_ids + tool_tokens | ||
| target_mask = target_mask + [0] * len(tool_tokens) | ||
|
Comment on lines
+46
to
+54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify the behavioral changes in tool formatting. The tool processing logic has been modified:
The second change alters the output format. Ensure that:
Run the following script to check if 🏁 Script executed: #!/bin/bash
# Description: Verify if tool_formater is used in other parts of the codebase
# Search for tool_formater usage
rg -n "tool_formater" --type=pyLength of output: 236 🏁 Script executed: #!/bin/bash
echo "Occurrences of function_formatter:"
rg -n "function_formatter" --type=py
echo
echo "Listing test files:"
find . -type f -name "*test*.py"Length of output: 399 Add tests and validate JSON tool serialization
🤖 Prompt for AI Agents |
||
|
|
||
| conversations = data["conversations"] | ||
|
|
||
|
|
@@ -65,7 +67,8 @@ def __getitem__(self, index): | |
| input_buffer += human | ||
|
|
||
| elif role == "function_call": | ||
| tool_calls = function_formatter(json.loads(content)) | ||
| # tool_calls = function_formatter(json.loads(content)) | ||
| tool_calls = content | ||
| function = self.function_format.format(content=tool_calls) | ||
| input_buffer += function | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify dependency compatibility and check for breaking changes.
The dependency versions have been updated with significant changes:
huggingface-hub: from exact pin0.29.1to range>=0.34.0,<1.0(major version jump)transformers: from exact pin4.49.0to minimum>=4.51.0(minor version jump)These changes relax version constraints, which improves flexibility but may introduce compatibility issues. Verify that:
Run the following script to check for known security vulnerabilities and verify the latest stable versions:
🏁 Script executed:
Length of output: 1382
Restrict transformers version to avoid ReDoS and breaking changes
Transformers <4.53.0 are vulnerable to multiple ReDoS issues; update requirement to
transformers>=4.53.0,<5.0.0.huggingface-hub
>=0.34.0,<1.0has no known advisories.🤖 Prompt for AI Agents