JohnSnowLabs / spark-nlp

State of the Art Natural Language Processing
https://sparknlp.org/
Apache License 2.0
3.88k stars 711 forks source link

[SPARKNLP-1027] llama.cpp integration #14364

Closed DevinTDHa closed 2 months ago

DevinTDHa commented 3 months ago

Description

This PR implements support for llama.cpp in Spark NLP.

llama.cpp is a high-performance C/C++ library designed for running Meta's LLaMA models and other large language models (LLMs) on a variety of hardware platforms.

This will enable users to do inference of LLMs wich a variety of optimizations:

Motivation and Context

Many users will have clusters with many smaller nodes. This will enable these nodes to also perform inference for LLMs with limited memory.

How Has This Been Tested?

Local tests, google colab, databricks

Types of changes

Checklist:

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10718481706

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/scala/com/johnsnowlabs/nlp/pretrained/ResourceDownloader.scala 0 2 0.0%
src/main/scala/com/johnsnowlabs/nlp/HasLlamaCppProperties.scala 0 381 0.0%
<!-- Total: 0 383 0.0% -->
Files with Coverage Reduction New Missed Lines %
src/main/scala/com/johnsnowlabs/nlp/annotators/DateMatcherTranslator.scala 1 89.35%
src/main/scala/com/johnsnowlabs/nlp/annotators/parser/dep/Tagger.scala 1 47.54%
src/main/scala/com/johnsnowlabs/nlp/annotators/ner/crf/FeatureGenerator.scala 1 94.41%
src/main/scala/com/johnsnowlabs/nlp/RawAnnotator.scala 1 80.0%
src/main/scala/com/johnsnowlabs/nlp/annotators/er/EntityRulerApproach.scala 1 95.11%
src/main/scala/com/johnsnowlabs/nlp/annotators/ner/dl/NerDLApproach.scala 1 80.0%
src/main/scala/com/johnsnowlabs/nlp/pretrained/ResourceDownloader.scala 1 41.04%
src/main/scala/com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala 1 52.59%
src/main/scala/com/johnsnowlabs/nlp/annotators/sda/vivekn/ViveknSentimentUtils.scala 1 52.94%
src/main/scala/com/johnsnowlabs/nlp/annotators/keyword/yake/YakeKeywordExtraction.scala 1 97.44%
<!-- Total: 49 -->
Totals Coverage Status
Change from base Build 10678787199: -1.6%
Covered Lines: 8981
Relevant Lines: 14911

💛 - Coveralls