-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
8e47d68
to
85c52c9
Compare
@@ -0,0 +1,62 @@ | |||
# BERT-SST2-Prod | |||
Reproduction process of BERT on SST2 dataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO 下个PR修改
一些注释修改等。可以先合入一版本。readme后续修改。 |
from reprod_log import ReprodLogger | ||
import torch | ||
import sys | ||
import os |
There was a problem hiding this comment.
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 * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import 也放前面,不要随便 import *
, 需要啥import啥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
下个PR修改文档部分。 |
New features
Docs
Description
Docs describe that how to transfer Pytorch BertModel into Paddle. including training,inference.etc