上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 404 下一页
摘要: Transformers 源码解析(八十六) .\models\owlvit\processing_owlvit.py # coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # Licensed under the Apache L 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(16) 评论(0) 推荐(0) 编辑
摘要: Transformers 源码解析(八十九) .\models\pix2struct\processing_pix2struct.py # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. # # Licensed under the 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(10) 评论(0) 推荐(0) 编辑
摘要: Transformers 源码解析(八十二) .\models\nllb_moe\modeling_nllb_moe.py # 定义一个函数,根据输入的 `input_ids` 张量,将其中的 token 向右移动一位 def shift_tokens_right(input_ids: torch. 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(13) 评论(0) 推荐(0) 编辑
摘要: Transformers 源码解析(八十八) .\models\perceiver\tokenization_perceiver.py # coding=utf-8 # 版权 2021 年 HuggingFace Inc. 团队。 # # 根据 Apache 许可证版本 2.0 授权。 # 除非符合 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(50) 评论(0) 推荐(0) 编辑
摘要: Transformers 源码解析(八十) .\models\mt5\modeling_tf_mt5.py # 设置文件编码为UTF-8 # 版权声明,指出代码的版权归属 # 版权使用协议,告知可在Apache License Version 2.0下使用 # 获取Apache License Ve 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(18) 评论(0) 推荐(0) 编辑
摘要: Transformers 源码解析(八) .\modeling_tf_outputs.py # 导入警告模块,用于处理警告信息 import warnings # 导入数据类装饰器,用于定义数据类 from dataclasses import dataclass # 导入类型提示,用于类型注解 f 阅读全文
posted @ 2024-06-29 15:48 绝不原创的飞龙 阅读(77) 评论(0) 推荐(0) 编辑
摘要: Lucidrains 系列项目源码解析(一) .\lucidrains\Adan-pytorch\adan_pytorch\adan.py import math import torch from torch.optim import Optimizer # 定义一个函数,用于检查变量是否存在 d 阅读全文
posted @ 2024-06-28 14:15 绝不原创的飞龙 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Lucidrains 系列项目源码解析(五十一) .\lucidrains\x-transformers\x_transformers\xval.py """ 定义了一个基于离散标记的常规变换器,但对于数字是连续的 更好地泛化了算术 https://arxiv.org/abs/2310.02989 阅读全文
posted @ 2024-06-28 14:14 绝不原创的飞龙 阅读(29) 评论(0) 推荐(0) 编辑
摘要: Lucidrains 系列项目源码解析(五十) .\lucidrains\x-clip\setup.py # 导入设置和查找包的函数 from setuptools import setup, find_packages # 设置包的信息 setup( # 包的名称 name = 'x-clip', 阅读全文
posted @ 2024-06-28 14:14 绝不原创的飞龙 阅读(20) 评论(0) 推荐(0) 编辑
摘要: Lucidrains 系列项目源码解析(五) .\lucidrains\byol-pytorch\byol_pytorch\trainer.py # 导入必要的库 from pathlib import Path import torch import torch.distributed as di 阅读全文
posted @ 2024-06-28 14:14 绝不原创的飞龙 阅读(11) 评论(0) 推荐(0) 编辑
上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 404 下一页