Skip to content

Commit d1a7840

Browse files
Merge pull request #67 from renderbus/zwy
feat: Updated documents related to hardware configuration parameters
2 parents 9fd2557 + 02e5cff commit d1a7840

File tree

2 files changed

+140
-88
lines changed

2 files changed

+140
-88
lines changed

render/SDK_tutorial.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,7 @@ update_task = {
9393
update_task_info(update_task, analyze_obj.task_json)
9494
```
9595

96-
##### 2. Specify the hardware configuration
97-
98-
The hardware configuration is controlled by the parameter "hardwareconfigid", which can be obtained through the API interface.("API interfaces use methods" --> "Get platform hardware configuration information")
99-
100-
If "ram" and "hardwareconfigid" are set in "Task_info"
101-
102-
以“hardwareConfigId”为主, 没有则以"ram"设置为主.
103-
104-
```
105-
from rayvision_api.utils import update_task_info, append_to_task, append_to_upload
106-
update_task = {
107-
"hardwareConfigId": "27" # 指定硬件配置
108-
}
109-
update_task_info(update_task, analyze_obj.task_json)
110-
```
111-
112-
##### 3. task.json add custom parameters
96+
##### 2. task.json add custom parameters
11397

11498
> The added custom parameters will be integrated into dictionary for key is "additional_info".
11599
【Warning】:Custom parameters will not take effect immediately. If you have this requirement, please contact our customer service。
@@ -123,7 +107,7 @@ custom_info_to_task = {
123107
append_to_task(custom_info_to_task, analyze_obj.task_json)
124108
```
125109

126-
##### 4. user custom upload.json
110+
##### 3. user custom upload.json
127111
> Support custom add file path to upload.json, will automatically deduplicate
128112
`append_to_upload(files_paths, upload_path)`
129113

@@ -136,14 +120,26 @@ custom_info_to_upload = [
136120
append_to_upload(custom_info_to_upload, analyze_obj.upload_json)
137121
```
138122

139-
### IV. Validate json file
123+
### IV. Setting hardware Configuration and Validate json file
124+
125+
The hardware configuration is controlled by the parameter "hardwareconfigid", which can be obtained through the API interface.("API interfaces use methods" --> "Get platform hardware configuration information")
126+
127+
Specify the hardware configuration by setting `model`, `ram`, `gpuNum` of hardware_config
128+
129+
```
130+
hardware_config = {
131+
"model": "Default", # Platform CPU: Default or Platform GPU: 1080Ti or 2080Ti
132+
"ram": "64GB", # memory: 64GB or 128GB
133+
"gpuNum": None # GPU platform requires input like 2*GPU, if CPU platform it is None
134+
}
135+
```
140136

141-
When validating, we check whether there is' user_id ', 'project_id', 'task_id' in task.json,
137+
When validating,we set the hardware configuration based on the hardware_config and check whether there is` user_id `, `project_id`, `task_id` in task.json,
142138
If not, the interface is called to fetch the relevant parameters from the server and write task.json
143139

144140
```
145141
check_obj = RayvisionCheck(api, analyze_obj)
146-
task_id = check_obj.execute(analyze_obj.task_json, analyze_obj.upload_json)
142+
task_id = check_obj.execute(hardware_config, analyze_obj.task_json, analyze_obj.upload_json)
147143
```
148144

149145
### V. Upload

0 commit comments

Comments
 (0)