microsoft/onnxruntime-extensions
Publicmirrored fromhttps://github.com/microsoft/onnxruntime-extensionsAvailable
.pipelines/templates/download-file.yml
21lines · modecode
| 1 | # Downloads a file from `url` and saves it to `outputFilePath`. |
| 2 | parameters: |
| 3 | - name: url |
| 4 | type: string |
| 5 | - name: outputFilePath |
| 6 | type: string |
| 7 | |
| 8 | steps: |
| 9 | - task: PythonScript@0 |
| 10 | inputs: |
| 11 | scriptSource: inline |
| 12 | script: | |
| 13 | import sys |
| 14 | import urllib.request |
| 15 | |
| 16 | url = sys.argv[1] |
| 17 | output_file_path = sys.argv[2] |
| 18 | |
| 19 | urllib.request.urlretrieve(url, filename=output_file_path) |
| 20 | arguments: '"${{ parameters.url }}" "${{ parameters.outputFilePath }}"' |
| 21 | displayName: "Download file from URL: ${{ parameters.url }}" |
| 22 | |