Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add paddle nv-embed-v1 #8785

Merged
merged 2 commits into from
Jul 28, 2024
Merged

Conversation

Li-Z-Q
Copy link
Contributor

@Li-Z-Q Li-Z-Q commented Jul 19, 2024

PR types

New features

PR changes

Models

Description

add paddle nv-embed-v1 embedding model, and integrate it into the MTEB evaluation framework

Copy link

paddle-bot bot commented Jul 19, 2024

Thanks for your contribution!

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.58%. Comparing base (57000fa) to head (6815387).
Report is 9 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8785      +/-   ##
===========================================
+ Coverage    55.44%   55.58%   +0.14%     
===========================================
  Files          626      630       +4     
  Lines        98065    98382     +317     
===========================================
+ Hits         54368    54683     +315     
- Misses       43697    43699       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 38 to 39
hf_model = LoRAModel.from_pretrained(base_model, peft_model_name, lora_config=lora_config, dtype="bfloat16")
return hf_model
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hf_model -> model

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Comment on lines 81 to 89
self.cross_attend_blocks_0_fn_to_kv = paddle.nn.Linear(in_features=4096, out_features=65536, bias_attr=False)
self.cross_attend_blocks_0_fn_to_out = paddle.nn.Linear(in_features=32768, out_features=4096, bias_attr=False)
self.cross_attend_blocks_0_fn_to_q = paddle.nn.Linear(in_features=4096, out_features=32768, bias_attr=False)
self.cross_attend_blocks_0_norm = paddle.nn.LayerNorm(4096)
self.cross_attend_blocks_0_norm_context = paddle.nn.LayerNorm(4096)

self.cross_attend_blocks_1_fn_net_0 = paddle.nn.Linear(in_features=4096, out_features=32768)
self.cross_attend_blocks_1_fn_net_2 = paddle.nn.Linear(in_features=16384, out_features=4096)
self.cross_attend_blocks_1_norm = paddle.nn.LayerNorm(4096)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个模型里面的参数大小为什么是写死的? 既然是基于Mistral,应该基于MistralConfig里面的大小

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改为:使用config.json中的参数值

```
export CUDA_VISIBLE_DEVICES=0
python eval_mteb.py \
--base_model_name_or_path NV-Embed-v1 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个NV-Embed-v1 是怎么得到的呢?从torch 转过来的吗?

Copy link
Contributor Author

@Li-Z-Q Li-Z-Q Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,陆老师发您的文件就是从torch转过来的paddle版本的NV-Embed-v1模型权重

Copy link
Collaborator

@sijunhe sijunhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sijunhe sijunhe merged commit ee4944e into PaddlePaddle:develop Jul 28, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants