Comments (4)
Actually, I solved the problem with multiprocessing. The need for pickling was produced by the pytorch bug when using multiple workers in the data loader.
from youtokentome.
This would be nice to have even if we can do multiprocessing without it.
from youtokentome.
Hi, you can do this to pickle the BPE object or any object that contains a BPE encoder.
import youtokentome as yttm
def bpe_reduce(self):
return (
self.__class__,
(str(MODEL_PATH),),
)
yttm.BPE.__reduce__ = bpe_reduce
Then pickle.dump
any instance of youtokentome.BPE
.
This will prevent pickle from saving the BPE object, but it will be able to re-instantiate it given the tuple (class, model_path) when you load your pickle file.
from youtokentome.
Closed in #81
from youtokentome.
Related Issues (20)
- ModuleNotFoundError: No module named 'Cython' when installing with pip version 23.1 HOT 5
- libc++abi Runtime error HOT 1
- Pre-tokenization viable?
- Special tokens accessibility
- Visual studio c++ 14.0 error while installing.
- ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
- Tokenizing large corpus HOT 2
- Using YouTokenToMe with pre-defined vocab and embeddings HOT 2
- How does YouTokenToMe's speed compare to subword-nmt?
- Error during installation
- No word tokenizer under the hood?
- Decode() got an unexpected keyword argument 'ignore_ids'
- error: Microsoft Visual C++ 14.0 or greater is required. HOT 1
- Installation error using pip HOT 3
- Installing error C1083 HOT 2
- How to optimize the usage of videomemory?
- compatibility of youtokentome.BPE outputs with the official implementation
- Can't pip install on a new env (without Cython) HOT 4
- Windows Support HOT 1
- Youtokentome cannot be installed on Windows if VisualStudio not installed HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youtokentome.