Code Monkey home page Code Monkey logo

sciwing's People

Contributors

abhinavkashyap avatar honhaochen avatar kzzj217 avatar yajingyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sciwing's Issues

How to run SciWing on GPU?

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!

Vector file for Neural-Parscit

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.