Comments (1)
In this modified version provided here, split() is called without specifying any separator, which defaults to splitting based on whitespace characters such as space, tab, or newline. This resolved the ValueError caused by the empty separator.You need to modify this tutorial as follows :
class NeMoGPTv2(NeMoGPT):
def setup_training_data(self, train_data_config: OmegaConf):
self.vocab = None
self._train_dl = self._setup_data_loader(train_data_config)
# Save the vocab into a text file for now
with open('vocab.txt', 'w') as f:
for token in self.vocab:
f.write(f"{token}")
# This is going to register the file into .nemo!
# When you later use .save_to(), it will copy this file into the tar file.
self.register_artifact('vocab_file', 'vocab.txt')
def setup_validation_data(self, val_data_config: OmegaConf):
vocab_file = self.register_artifact('vocab_file', 'vocab.txt')
with open(vocab_file, 'r') as f:
vocab = f.read().split()[:-1] # Split based on whitespace characters
self.vocab = vocab
self._validation_dl = self._setup_data_loader(val_data_config)
def setup_test_data(self, test_data_config: OmegaConf):
# This is going to try to find the same file, and if it fails,
# it will use the copy in .nemo
vocab_file = self.register_artifact('vocab_file', 'vocab.txt')
with open(vocab_file, 'r') as f:
vocab = []
vocab = f.read().split()[:-1] # the -1 here is for the dangling token in the file
self.vocab = vocab
self._test_dl = self._setup_data_loader(test_data_config)
from nemo.
Related Issues (20)
- why we reverse the RGB channels in video processor HOT 1
- Error(s): ConfidenceConfig.__init__() got an unexpected keyword argument 'measure_cfg' HOT 12
- ImportError: cannot import name '_library_root_logger' from 'apex' (unknown location)
- Citrinet Training: Sentences are cut during prediction HOT 1
- Unable to disable validation
- Why isn't FSDP supported by DistributedCheckpointIO?
- video input 'image_aspect_ratio=pad' not work
- Nemo_toolkit 2.0.0.rc0 installation failure HOT 12
- FSDP reduce_scatter can not overlap with compute HOT 1
- Getting `TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.`
- Python 3.11 dataclasses ValueError
- RAM memory leaks for EncDecCTCModelBPE at inference
- Conflict between bf16-mixed Precision Setting and MegatronHalfPrecisionPlugin in MegatronGPT Training HOT 2
- FastConformer-Longformer HOT 2
- CTC Language Finetuning convergence HOT 1
- Can we run NeMo MSDD Neural Diarizer model in realtime for realtime diarization? HOT 2
- Latest release version 1.23.0 missing the AudioCodecModel checkpoint list. HOT 1
- NLP isn't getting imported due to ApexGuardDefaults HOT 1
- Job specific environment variables can't be set in Hydra multi-run HOT 2
- Using lhotse when training a hybrid fast conformer model fails
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 nemo.