GithubHelp home page GithubHelp logo

bert-ml.net's People

Contributors

gerjanvl avatar gigabyte0x1337 avatar justinormont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bert-ml.net's Issues

BERT-ML.NET NER

Hi !
Thank you for the project. It was a great help. Is it possible to create examples for the NER model?

How to run this repo?

@gerjanvl @GerjanVlot After downloading pretrained model to desired location , what command should I follow to run local server on ASP.NET?
Thanks

Typo in the description

Take a look at
"Question and Answering (Q&A) BERT model implimentation for ML.NET." <- implementation

How to load the model and vocabulary from a SQL Server database?

In the current implementation we load the model from a file: bertsquad-10.onnx
By some reasons I'd like to upload this file to a database (SQL Server) and load it from the database.
Is it possible to do it?
For example, I want to move your code to SQLCLR function. It is impossible to work with file in a common case.
And the best way is to load vocabulary and model from a database.

Console Application error.

So, I updated this project (complete solution) to dotnet 6.0... The WebApi works, but the ConsoleApplication fails out with this error code:

/BERT-ML.NET-master/BERT.Console/bin/Debug/net6.0/BERT.Console "Bob is walking through the woods collecting blueberries and strawberries to make a pie." "What is his name?"
Unhandled exception. System.InvalidOperationException: Error initializing model :Microsoft.ML.OnnxRuntime.OnnxRuntimeException: [ErrorCode:InvalidProtobuf] Load model from Model/bertsquad-10.onnx failed:Protobuf parsing failed.
   at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus)
   at Microsoft.ML.OnnxRuntime.InferenceSession.Init(String modelPath, SessionOptions options, PrePackedWeightsContainer prepackedWeightsContainer)
   at Microsoft.ML.OnnxRuntime.InferenceSession..ctor(String modelPath, SessionOptions options)
   at Microsoft.ML.Transforms.Onnx.OnnxModel..ctor(String modelFile, Nullable`1 gpuDeviceId, Boolean fallbackToCpu, Boolean ownModelFile, IDictionary`2 shapeDictionary, Int32 recursionLimit, Nullable`1 interOpNumThreads, Nullable`1 intraOpNumThreads)
   at Microsoft.ML.Transforms.Onnx.OnnxTransformer..ctor(IHostEnvironment env, Options options, Byte[] modelBytes)
 ---> Microsoft.ML.OnnxRuntime.OnnxRuntimeException: [ErrorCode:InvalidProtobuf] Load model from Model/bertsquad-10.onnx failed:Protobuf parsing failed.
   at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus)
   at Microsoft.ML.OnnxRuntime.InferenceSession.Init(String modelPath, SessionOptions options, PrePackedWeightsContainer prepackedWeightsContainer)
   at Microsoft.ML.OnnxRuntime.InferenceSession..ctor(String modelPath, SessionOptions options)
   at Microsoft.ML.Transforms.Onnx.OnnxModel..ctor(String modelFile, Nullable`1 gpuDeviceId, Boolean fallbackToCpu, Boolean ownModelFile, IDictionary`2 shapeDictionary, Int32 recursionLimit, Nullable`1 interOpNumThreads, Nullable`1 intraOpNumThreads)
   at Microsoft.ML.Transforms.Onnx.OnnxTransformer..ctor(IHostEnvironment env, Options options, Byte[] modelBytes)
   --- End of inner exception stack trace ---
   at Microsoft.ML.Transforms.Onnx.OnnxTransformer..ctor(IHostEnvironment env, Options options, Byte[] modelBytes)
   at Microsoft.ML.Transforms.Onnx.OnnxTransformer..ctor(IHostEnvironment env, String[] outputColumnNames, String[] inputColumnNames, String modelFile, Nullable`1 gpuDeviceId, Boolean fallbackToCpu, IDictionary`2 shapeDictionary, Int32 recursionLimit, Nullable`1 interOpNumThreads, Nullable`1 intraOpNumThreads)
   at Microsoft.ML.Transforms.Onnx.OnnxScoringEstimator..ctor(IHostEnvironment env, String[] outputColumnNames, String[] inputColumnNames, String modelFile, Nullable`1 gpuDeviceId, Boolean fallbackToCpu, IDictionary`2 shapeDictionary, Int32 recursionLimit, Nullable`1 interOpNumThreads, Nullable`1 intraOpNumThreads)
   at Microsoft.ML.OnnxCatalog.ApplyOnnxModel(TransformsCatalog catalog, String[] outputColumnNames, String[] inputColumnNames, String modelFile, Nullable`1 gpuDeviceId, Boolean fallbackToCpu)
   at Microsoft.ML.Models.BERT.Onnx.OnnxModelConfigurator`1.SetupMlNetModel(IOnnxModel onnxModel) in /home/michieal/Desktop/Projects/projects/RiderProjects/BERT-ML.NET-master/Microsoft.ML.Models.BERT/Onnx/OnnxModelConfigurator.cs:line 25
   at Microsoft.ML.Models.BERT.Onnx.OnnxModelConfigurator`1..ctor(IOnnxModel onnxModel) in /home/michieal/Desktop/Projects/projects/RiderProjects/BERT-ML.NET-master/Microsoft.ML.Models.BERT/Onnx/OnnxModelConfigurator.cs:line 15
   at Microsoft.ML.Models.BERT.BertModel.Initialize() in /home/michieal/Desktop/Projects/projects/RiderProjects/BERT-ML.NET-master/Microsoft.ML.Models.BERT/BertModel.cs:line 30
   at BERT.Console.Program.Main(String[] args) in /home/michieal/Desktop/Projects/projects/RiderProjects/BERT-ML.NET-master/BERT.Console/Program.cs:line 18

Process finished with exit code 134.

I'm pretty curious as to how to fix this, as it should either work for both projects in the solution, or fail for both. Mind you, I had to download a new copy of the bert-squad 10 onnx model, as the one that the shell file grabbed was corrupt and only 137k, instead of ~400mb.

My use case: Learning about BERT models, and having it do Q&A's as a front end for a generative text AI Model.

Any and all help with this is very much appreciated and TIA!!!

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.