Skip to content

test: add TestAutoModelfile#84

Merged
chlins merged 6 commits intomainfrom
add-automodelfile-test
Feb 26, 2025
Merged

test: add TestAutoModelfile#84
chlins merged 6 commits intomainfrom
add-automodelfile-test

Conversation

@aftersnow
Copy link
Contributor

No description provided.

@aftersnow aftersnow requested review from chlins and gaius-qi February 26, 2025 04:44
Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Adds a new cleanModelName function to sanitize model names by:
- Removing trailing slashes
- Replacing invalid characters with underscores
- Trimming leading/trailing underscores
- Providing a default name for empty inputs

Updates AutoModelfile to use the new cleanModelName function when generating model names

Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
This change modifies the Paramsize field in ModelfileGenConfig from a string to a uint64, updating related code in generate.go, modelfile.go, and modelfile_test.go to support numeric parameter size representation. The changes include:

- Updated CLI flag type from string to uint64
- Modified ModelfileGenConfig struct
- Updated test cases to use numeric parameter sizes
- Converted Paramsize to string representation when needed

Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
- Add more descriptive error messages for modelfile generation
- Enhance validation checks in AutoModelfile method
- Improve handling of unrecognized files and empty directories
- Add nil config check and more informative error messages
- Update comments for better code readability

Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
@aftersnow aftersnow force-pushed the add-automodelfile-test branch from 8907dde to 6292a5b Compare February 26, 2025 10:09
- Reverted Paramsize type from uint64 to string
- Updated CLI flag to accept string parameter sizes like "7B", "13B"
- Modified ModelfileGenConfig and related code to support string-based parameter sizes
- Updated test cases to use string parameter size representation

Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
…le detection

- Convert model and modelfile paths to absolute paths
- Remove redundant absolute path conversion
- Add special handling for current and parent directory in skippable file detection
- Simplify error handling for path-related operations

Signed-off-by: Zhao Chen <zhaochen.zju@gmail.com>
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

@chlins chlins merged commit b5bcb07 into main Feb 26, 2025
5 checks passed
@chlins chlins deleted the add-automodelfile-test branch February 26, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants