We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
old:
def init_predict_var(path): label2id_file = os.path.join(path, 'label2id.pkl') if os.path.exists(label2id_file): with open(label2id_file, 'rb') as rf: label2id = pickle.load(rf) id2label = {value: key for key, value in label2id.items()} num_labels = len(label2id.items()) return num_labels, label2id, id2label
new:
def init_predict_var(path): num_labels, label2id, id2label = [None]*3 label2id_file = os.path.join(path, 'label2id.pkl') if os.path.exists(label2id_file): with open(label2id_file, 'rb') as rf: label2id = pickle.load(rf) id2label = {value: key for key, value in label2id.items()} num_labels = len(label2id.items()) return num_labels, label2id, id2label
then your need to import pickle import pickle
import pickle
The text was updated successfully, but these errors were encountered:
No branches or pull requests
old:
new:
then your need to import pickle
import pickle
The text was updated successfully, but these errors were encountered: