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

[Tutorial] Add torch migration #3641

Merged
merged 2 commits into from
Nov 3, 2022
Merged

Conversation

ymyjl
Copy link
Contributor

@ymyjl ymyjl commented Nov 1, 2022

New features

Docs

Description

Docs describe that how to transfer Pytorch BertModel into Paddle. including training,inference.etc

@CLAassistant
Copy link

CLAassistant commented Nov 1, 2022

CLA assistant check
All committers have signed the CLA.

@ymyjl ymyjl force-pushed the nlp_transfer branch 2 times, most recently from 8e47d68 to 85c52c9 Compare November 2, 2022 03:35
@ZHUI ZHUI self-requested a review November 2, 2022 03:35
@@ -0,0 +1,62 @@
# BERT-SST2-Prod
Reproduction process of BERT on SST2 dataset
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO 下个PR修改

@ZHUI ZHUI changed the title add torch_migration [Tutorial] Add torch migration Nov 2, 2022
@ZHUI
Copy link
Collaborator

ZHUI commented Nov 2, 2022

一些注释修改等。可以先合入一版本。readme后续修改。

@ZHUI ZHUI requested a review from wawltor November 2, 2022 03:45
from reprod_log import ReprodLogger
import torch
import sys
import os
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里的 import 顺序需要遵循,pep8

CURRENT_DIR = os.path.split(os.path.abspath(__file__))[0] # 当前目录
config_path = CURRENT_DIR.rsplit('/', 1)[0]
sys.path.append(config_path)
from models.pt_bert import *
Copy link
Collaborator

Choose a reason for hiding this comment

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

import 也放前面,不要随便 import *, 需要啥import啥

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Nov 2, 2022
@PaddlePaddle PaddlePaddle unlocked this conversation Nov 2, 2022
Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@ZHUI
Copy link
Collaborator

ZHUI commented Nov 3, 2022

下个PR修改文档部分。

@ZHUI ZHUI merged commit 1fc23a8 into PaddlePaddle:develop Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants