wing-nus / sciwing Goto Github PK
View Code? Open in Web Editor NEWThis project forked from abhinavkashyap/sciwing
SciWING is a modern toolkit for scientific document processing from WING-NUS
License: MIT License
This project forked from abhinavkashyap/sciwing
SciWING is a modern toolkit for scientific document processing from WING-NUS
License: MIT License
This package is amazing, so thank you so much! I'm trying to parse a bunch of documents and I noticed that despite a GPU being available and torch recognizing it, the sciwing package won't run its models on the GPU. For example, if I run this code:
from sciwing.models.neural_parscit import NeuralParscit
neural_parscit = NeuralParscit()
device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
neural_parscit.to(device)
I get the following error suggesting that the model won't put the data on to the GPU.
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/models/neural_parscit.py", line 164, in predict_for_text
predictions = self._predict(line=text)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/models/neural_parscit.py", line 111, in _predict
predictions = self.infer.on_user_input(line=line)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/infer/seq_label_inference/seq_label_inference.py", line 285, in on_user_input
return self.infer_batch(lines=[line])
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/infer/seq_label_inference/seq_label_inference.py", line 298, in infer_batch
model_output_dict = self.model_forward_on_lines(lines=lines_)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/infer/seq_label_inference/seq_label_inference.py", line 140, in model_forward_on_lines
model_output_dict = self.model(
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/models/rnn_seq_crf_tagger.py", line 115, in forward
encoding = self.rnn2seqencoder(lines=lines)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/modules/lstm2seqencoder.py", line 121, in forward
embeddings = self.embedder(lines=lines)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/modules/embedders/concat_embedders.py", line 46, in forward
embedding = embedder(lines)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/sciwing/modules/embedders/trainable_word_embedder.py", line 75, in forward
embedding = self.embedding(numericalized_tokens)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 156, in forward
return F.embedding(
File "/opt/anaconda/envs/sciwing/lib/python3.8/site-packages/torch/nn/functional.py", line 1916, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Input, output and indices must be on the current device
Is there a standard way of having SciWing run on a GPU? I couldn't find anything in the documentation or poking around. Thanks!
I have intention to use a Vector File for Neural-ParsCit. Can someone please guide me how I can achieve this using sciwing?
I appreciate this great help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.