适应新版本 transformers 库 & 添加更多默认搜索的扩展名 - #2
Open
zhdbk3 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本 PR 包含以下两个部分:
适应新版本 transformers 库
在新版本的 transformers 库中,
model.get_image_features()和model.get_text_features()已不再直接返回张量,而是返回一个BaseModelOutputWithPooling对象(可参见 huggingface/lerobot#3418 )。这导致您的代码现在无法直接运行(requirements.txt 中也没有限定为旧版本),报错:'BaseModelOutputWithPooling' object has no attribute 'cpu'
本 PR 在需要的位置添加了
.pooler_output以提取张量,这样就可以正常运行了。添加更多默认搜索的扩展名
常用的表情包扩展名有 .jpg .png .gif 等。然而,当前默认为:
这让项目默认情况下并不会扫描到许多常见扩展名的文件(包括该仓库里的示例,也是用的 .jpg,扫出来都是空的)。这可能会给新用户带来一定的困扰。所以我添加了 .jpg .png .gif。
此外,我建议在文档中对这一配置项做出说明。
看到这个优秀的项目真的让我眼前一亮。希望您能考虑我的建议,非常感谢!