国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| response.setCharacterEncoding(request.getCharacterEncoding()); | |
| response.setContentType(MediaType.APPLICATION_OCTET_STREAM.toString()); | |
| String realFileName = URLEncoder.encode(realFileName, StandardCharsets.UTF_8.toString()); | |
| // 解决中文文件名乱码关键行 | |
| response.setHeader("Content-Disposition", "attachment; filename=\"" + realFileName + "\"; filename*=utf-8''" + realFileName); | |
| Path path = Paths.get(filePath+filename); | |
| Files.copy(path, response.getOutputStream()); | |
| response.flushBuffer(); |