-
Notifications
You must be signed in to change notification settings - Fork 114
docs: clarify dataset format configuration for testenv #377
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
Open
krrish175-byte
wants to merge
2
commits into
kubeedge:main
Choose a base branch
from
krrish175-byte:fix/issue-110
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,29 +13,60 @@ For example: | |||||||||
|
|
||||||||||
| ```yaml | ||||||||||
| testenv: | ||||||||||
| # dataset configuration | ||||||||||
| dataset: | ||||||||||
| ... | ||||||||||
| # metrics configuration for test case's evaluation; list type; | ||||||||||
| metrics: | ||||||||||
| ... | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ### The configuration of dataset | ||||||||||
|
|
||||||||||
| | Property | Required | Description | | ||||||||||
| |----------|----------|-------------| | ||||||||||
| |Property|Required|Description| | ||||||||||
| |---|---|---| | ||||||||||
| |train_url|yes|The url address of train dataset index; Type: string| | ||||||||||
| |test_url|yes|The url address of test dataset index; Type: string| | ||||||||||
|
|
||||||||||
| #### Supported Data Formats | ||||||||||
|
|
||||||||||
| The dataset files can be provided in several formats. The supported data formats are **TXT**, **CSV**, **JSON**, and **JSONL**. | ||||||||||
|
|
||||||||||
| Here is how the data files should be prepared depending on the format: | ||||||||||
|
|
||||||||||
| ##### 1. TXT Format | ||||||||||
| For TXT format, each line typically represents a single data record or a path to a data file, optionally followed by its corresponding label separated by a space. | ||||||||||
| ```txt | ||||||||||
| /path/to/image1.jpg dog | ||||||||||
| /path/to/image2.jpg cat | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ##### 2. CSV Format | ||||||||||
| For CSV format, the file should contain comma-separated values. It usually includes headers, where one column represents the data (or path to data) and another represents the label. | ||||||||||
| ```csv | ||||||||||
| image_path,label | ||||||||||
| /path/to/image1.jpg,dog | ||||||||||
| /path/to/image2.jpg,cat | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ##### 3. JSON / JSONL Format | ||||||||||
| For JSON format, it can be a JSON array of objects, or JSON Lines (JSONL) where each line is a valid JSON object. | ||||||||||
| ```json | ||||||||||
| [ | ||||||||||
| {"image": "/path/to/image1.jpg", "label": "dog"}, | ||||||||||
| {"image": "/path/to/image2.jpg", "label": "cat"} | ||||||||||
| ] | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Or JSONL: | ||||||||||
| ```json | ||||||||||
| {"image": "/path/to/image1.jpg", "label": "dog"} | ||||||||||
| {"image": "/path/to/image2.jpg", "label": "cat"} | ||||||||||
|
Comment on lines
+61
to
+62
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. For consistency with the CSV example, please use
Suggested change
|
||||||||||
| ``` | ||||||||||
|
|
||||||||||
| For example: | ||||||||||
|
|
||||||||||
| ```yaml | ||||||||||
| # dataset configuration | ||||||||||
| dataset: | ||||||||||
| # the url address of train dataset index; string type; | ||||||||||
| train_index: "./dataset/mmlu-5-shot/train_data/data.json" | ||||||||||
| # the url address of test dataset index; string type; | ||||||||||
| test_index: "./dataset/mmlu-5-shot/test_data/metadata.json" | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
|
|
@@ -65,18 +96,12 @@ You can select multiple metrics in `examples/cloud-edge-collaborative-inference- | |||||||||
| ```yaml | ||||||||||
| # testenv.yaml | ||||||||||
| testenv: | ||||||||||
| # dataset configuration | ||||||||||
| dataset: | ||||||||||
| # the url address of train dataset index; string type; | ||||||||||
| train_data: "./dataset/mmlu-5-shot/train_data/data.json" | ||||||||||
| # the url address of test dataset index; string type; | ||||||||||
| test_data_info: "./dataset/mmlu-5-shot/test_data/metadata.json" | ||||||||||
|
|
||||||||||
| # metrics configuration for test case's evaluation; list type; | ||||||||||
| metrics: | ||||||||||
| # metric name; string type; | ||||||||||
| - name: "Accuracy" | ||||||||||
| # the url address of python file | ||||||||||
| url: "./examples/cloud-edge-collaborative-inference-for-llm/testenv/accuracy.py" | ||||||||||
|
|
||||||||||
| - name: "Edge Ratio" | ||||||||||
|
|
||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
For consistency with the CSV example which uses
image_path, it would be clearer to also useimage_pathhere as the key for the path to the data.