This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VOCAB= ascii_uppercase+digits+punctuation+" \t\n" | |
#Change to CUDA to run using GPU | |
device = 'cpu' | |
def get_test_data(etfo): | |
text = etfo | |
text_tensor = torch.zeros(len(text), 1, dtype=torch.long) | |
text_tensor[:, 0] = torch.LongTensor([VOCAB.find(c) for c in text]) | |
return text_tensor.to(device) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.