MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / download

Function download

tensorflow/go/example_inception_inference_test.go:254–267  ·  view source on GitHub ↗
(URL, filename string)

Source from the content-addressed store, hash-verified

252}
253
254func download(URL, filename string) error {
255 resp, err := http.Get(URL)
256 if err != nil {
257 return err
258 }
259 defer resp.Body.Close()
260 file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE, 0644)
261 if err != nil {
262 return err
263 }
264 defer file.Close()
265 _, err = io.Copy(file, resp.Body)
266 return err
267}
268
269func unzip(dir, zipfile string) error {
270 r, err := zip.OpenReader(zipfile)

Callers 1

modelFilesFunction · 0.70

Calls 3

GetMethod · 0.45
CloseMethod · 0.45
CopyMethod · 0.45

Tested by

no test coverage detected