AI 应用开发技术栈
· ☕ 4 分钟
Embedding 模型 Embedding 模式将高维度的数据映射到低维度的空间,这样有利于数据的处理和分析。 文本模型 这里有一个排行榜,https://huggingface.co/spaces/mteb/leaderboard 在上面的排行榜中,会给出模型的评分,模型的参数量

在 Kubernetes 部署 Jumpserver 跳板机
· ☕ 3 分钟
1. 部署 Jumpserver 需要提前准备好 StorageClass,用于存储 Jumpserver 的数据。除了下面提到的数据库,各个组件 jms-core、jms-web、jms-koko、jms-lion、jms-chen 都需要一个 PV 存储。 1.1 部署 MySQL 参考 https://github.com/shaowenchen/ops-hub/blob/main/database/mysql8.yaml ,部署 MySQL。 需要调整

使用 Ops 项目查看并监控集群事件
· ☕ 2 分钟
https://github.com/shaowenchen/ops 1. 告警 Kubernetes 集群的事件 监控指定的关键字 1 2 3 4 5 6 7 8 9 10 11 apiVersion: crd.chenshaowen.com/v1 kind: EventHooks metadata: name: kube-pod-falid namespace: ops-system spec: type: xiezuo url: https://xxx.com/api/v1/webhook/send?key=xxx subject: "ops.clusters.*.namespaces.*.pods.*.event" keywords: - failed 一份简单的配置,即可收获大量的相关告警。 监控之后,自动化处理 1 2 3 4 5 6 7 8 9 10 11 12 apiVersion: crd.chenshaowen.com/v1 kind: EventHooks metadata: name: kube-no-free-node namespace: ops-system spec: additional: "action: restart-kubelet-bypod" keywords: - no free node subject: ops.clusters.*.namespaces.*.pods.*.event type: webhook url: http://x.x.x.x/webhook 借助 Ops Copilot 的执

使用 TensorBoard 可视化 PyTorch 训练过程
· ☕ 4 分钟
1. 什么是 TensorBoard TensorBoard 主要是用来监控模型的各种指标的变化,比如 accuracy、loss、各种层的权重分布等。 TensorBoard 是 TensorFlow 的一个可视化工具,支持标量、文本、图像、音频、视频和 Embedding 等多种数据可视化,但是 PyTorch 也可以使用 TensorBoard。 2. 安装 tensorboard 1 pip install tensorboard 3. 使用

使用 PyTorch 在 MNIST 数据集训练模型
· ☕ 3 分钟
1. 创建训练脚本 创建训练脚本 mnist.py,内容如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93