spark-nlp 6.0.5__py2.py3-none-any.whl → 6.1.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spark-nlp might be problematic. Click here for more details.
- {spark_nlp-6.0.5.dist-info → spark_nlp-6.1.1.dist-info}/METADATA +12 -11
- {spark_nlp-6.0.5.dist-info → spark_nlp-6.1.1.dist-info}/RECORD +15 -12
- sparknlp/__init__.py +1 -1
- sparknlp/annotator/embeddings/auto_gguf_embeddings.py +4 -12
- sparknlp/annotator/seq2seq/__init__.py +1 -0
- sparknlp/annotator/seq2seq/auto_gguf_model.py +10 -7
- sparknlp/annotator/seq2seq/auto_gguf_vision_model.py +3 -3
- sparknlp/annotator/seq2seq/phi4_transformer.py +387 -0
- sparknlp/common/properties.py +114 -85
- sparknlp/internal/__init__.py +9 -0
- sparknlp/reader/reader2doc.py +210 -0
- sparknlp/reader/reader2table.py +163 -0
- sparknlp/reader/sparknlp_reader.py +45 -0
- {spark_nlp-6.0.5.dist-info → spark_nlp-6.1.1.dist-info}/WHEEL +0 -0
- {spark_nlp-6.0.5.dist-info → spark_nlp-6.1.1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spark-nlp
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.1.1
|
|
4
4
|
Summary: John Snow Labs Spark NLP is a natural language processing library built on top of Apache Spark ML. It provides simple, performant & accurate NLP annotations for machine learning pipelines, that scale easily in a distributed environment.
|
|
5
5
|
Home-page: https://github.com/JohnSnowLabs/spark-nlp
|
|
6
6
|
Author: John Snow Labs
|
|
@@ -58,7 +58,7 @@ Dynamic: summary
|
|
|
58
58
|
|
|
59
59
|
Spark NLP is a state-of-the-art Natural Language Processing library built on top of Apache Spark. It provides **simple**, **performant** & **accurate** NLP annotations for machine learning pipelines that **scale** easily in a distributed environment.
|
|
60
60
|
|
|
61
|
-
Spark NLP comes with **
|
|
61
|
+
Spark NLP comes with **100000+** pretrained **pipelines** and **models** in more than **200+** languages.
|
|
62
62
|
It also offers tasks such as **Tokenization**, **Word Segmentation**, **Part-of-Speech Tagging**, Word and Sentence **Embeddings**, **Named Entity Recognition**, **Dependency Parsing**, **Spell Checking**, **Text Classification**, **Sentiment Analysis**, **Token Classification**, **Machine Translation** (+180 languages), **Summarization**, **Question Answering**, **Table Question Answering**, **Text Generation**, **Image Classification**, **Image to Text (captioning)**, **Automatic Speech Recognition**, **Zero-Shot Learning**, and many more [NLP tasks](#features).
|
|
63
63
|
|
|
64
64
|
**Spark NLP** is the only open-source NLP library in **production** that offers state-of-the-art transformers such as **BERT**, **CamemBERT**, **ALBERT**, **ELECTRA**, **XLNet**, **DistilBERT**, **RoBERTa**, **DeBERTa**, **XLM-RoBERTa**, **Longformer**, **ELMO**, **Universal Sentence Encoder**, **Llama-2**, **M2M100**, **BART**, **Instructor**, **E5**, **Google T5**, **MarianMT**, **OpenAI GPT2**, **Vision Transformers (ViT)**, **OpenAI Whisper**, **Llama**, **Mistral**, **Phi**, **Qwen2**, and many more not only to **Python** and **R**, but also to **JVM** ecosystem (**Java**, **Scala**, and **Kotlin**) at **scale** by extending **Apache Spark** natively.
|
|
@@ -102,7 +102,7 @@ $ java -version
|
|
|
102
102
|
$ conda create -n sparknlp python=3.7 -y
|
|
103
103
|
$ conda activate sparknlp
|
|
104
104
|
# spark-nlp by default is based on pyspark 3.x
|
|
105
|
-
$ pip install spark-nlp==6.
|
|
105
|
+
$ pip install spark-nlp==6.1.1 pyspark==3.3.1
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
In Python console or Jupyter `Python3` kernel:
|
|
@@ -168,11 +168,11 @@ For a quick example of using pipelines and models take a look at our official [d
|
|
|
168
168
|
|
|
169
169
|
### Apache Spark Support
|
|
170
170
|
|
|
171
|
-
Spark NLP *6.
|
|
171
|
+
Spark NLP *6.1.1* has been built on top of Apache Spark 3.4 while fully supports Apache Spark 3.0.x, 3.1.x, 3.2.x, 3.3.x, 3.4.x, and 3.5.x
|
|
172
172
|
|
|
173
173
|
| Spark NLP | Apache Spark 3.5.x | Apache Spark 3.4.x | Apache Spark 3.3.x | Apache Spark 3.2.x | Apache Spark 3.1.x | Apache Spark 3.0.x | Apache Spark 2.4.x | Apache Spark 2.3.x |
|
|
174
174
|
|-----------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|
|
175
|
-
| 6.
|
|
175
|
+
| 6.x.x and up | YES | YES | YES | YES | YES | YES | NO | NO |
|
|
176
176
|
| 5.5.x | YES | YES | YES | YES | YES | YES | NO | NO |
|
|
177
177
|
| 5.4.x | YES | YES | YES | YES | YES | YES | NO | NO |
|
|
178
178
|
| 5.3.x | YES | YES | YES | YES | YES | YES | NO | NO |
|
|
@@ -198,7 +198,7 @@ Find out more about 4.x `SparkNLP` versions in our official [documentation](http
|
|
|
198
198
|
|
|
199
199
|
### Databricks Support
|
|
200
200
|
|
|
201
|
-
Spark NLP 6.
|
|
201
|
+
Spark NLP 6.1.1 has been tested and is compatible with the following runtimes:
|
|
202
202
|
|
|
203
203
|
| **CPU** | **GPU** |
|
|
204
204
|
|--------------------|--------------------|
|
|
@@ -206,16 +206,17 @@ Spark NLP 6.0.5 has been tested and is compatible with the following runtimes:
|
|
|
206
206
|
| 14.2 / 14.2 ML | 14.2 ML & GPU |
|
|
207
207
|
| 14.3 / 14.3 ML | 14.3 ML & GPU |
|
|
208
208
|
| 15.0 / 15.0 ML | 15.0 ML & GPU |
|
|
209
|
-
| 15.1 / 15.
|
|
210
|
-
| 15.2 / 15.
|
|
211
|
-
| 15.3 / 15.
|
|
212
|
-
| 15.4 / 15.
|
|
209
|
+
| 15.1 / 15.1 ML | 15.1 ML & GPU |
|
|
210
|
+
| 15.2 / 15.2 ML | 15.2 ML & GPU |
|
|
211
|
+
| 15.3 / 15.3 ML | 15.3 ML & GPU |
|
|
212
|
+
| 15.4 / 15.4 ML | 15.4 ML & GPU |
|
|
213
|
+
| 16.4 / 16.4 ML | 16.4 ML & GPU |
|
|
213
214
|
|
|
214
215
|
We are compatible with older runtimes. For a full list check databricks support in our official [documentation](https://sparknlp.org/docs/en/install#databricks-support)
|
|
215
216
|
|
|
216
217
|
### EMR Support
|
|
217
218
|
|
|
218
|
-
Spark NLP 6.
|
|
219
|
+
Spark NLP 6.1.1 has been tested and is compatible with the following EMR releases:
|
|
219
220
|
|
|
220
221
|
| **EMR Release** |
|
|
221
222
|
|--------------------|
|
|
@@ -3,7 +3,7 @@ com/johnsnowlabs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
|
3
3
|
com/johnsnowlabs/ml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
com/johnsnowlabs/ml/ai/__init__.py,sha256=YQiK2M7U4d8y5irPy_HB8ae0mSpqS9583MH44pnKJXc,295
|
|
5
5
|
com/johnsnowlabs/nlp/__init__.py,sha256=DPIVXtONO5xXyOk-HB0-sNiHAcco17NN13zPS_6Uw8c,294
|
|
6
|
-
sparknlp/__init__.py,sha256=
|
|
6
|
+
sparknlp/__init__.py,sha256=sEwJ50P2C-LGn-MZ8oI6jO6N0OutYSL3b6bCVkOo2wc,13814
|
|
7
7
|
sparknlp/annotation.py,sha256=I5zOxG5vV2RfPZfqN9enT1i4mo6oBcn3Lrzs37QiOiA,5635
|
|
8
8
|
sparknlp/annotation_audio.py,sha256=iRV_InSVhgvAwSRe9NTbUH9v6OGvTM-FPCpSAKVu0mE,1917
|
|
9
9
|
sparknlp/annotation_image.py,sha256=xhCe8Ko-77XqWVuuYHFrjKqF6zPd8Z-RY_rmZXNwCXU,2547
|
|
@@ -105,7 +105,7 @@ sparknlp/annotator/dependency/dependency_parser.py,sha256=SxyvHPp8Hs1Xnm5X1nLTMi
|
|
|
105
105
|
sparknlp/annotator/dependency/typed_dependency_parser.py,sha256=60vPdYkbFk9MPGegg3m9Uik9cMXpMZd8tBvXG39gNww,12456
|
|
106
106
|
sparknlp/annotator/embeddings/__init__.py,sha256=Aw1oaP5DI0OS6259c0TEZZ6j3VFSvYFEerah5a-udVw,2528
|
|
107
107
|
sparknlp/annotator/embeddings/albert_embeddings.py,sha256=6Rd1LIn8oFIpq_ALcJh-RUjPEO7Ht8wsHY6JHSFyMkw,9995
|
|
108
|
-
sparknlp/annotator/embeddings/auto_gguf_embeddings.py,sha256=
|
|
108
|
+
sparknlp/annotator/embeddings/auto_gguf_embeddings.py,sha256=TRAYbhGS4K8uSpsScvDr6uD3lYdxMpCUjwDMhV_74rM,19977
|
|
109
109
|
sparknlp/annotator/embeddings/bert_embeddings.py,sha256=HVUjkg56kBcpGZCo-fmPG5uatMDF3swW_lnbpy1SgSI,8463
|
|
110
110
|
sparknlp/annotator/embeddings/bert_sentence_embeddings.py,sha256=NQy9KuXT9aKsTpYCR5RAeoFWI2YqEGorbdYrf_0KKmw,9148
|
|
111
111
|
sparknlp/annotator/embeddings/bge_embeddings.py,sha256=ZGbxssjJFaSfbcgqAPV5hsu81SnC0obgCVNOoJkArDA,8105
|
|
@@ -167,9 +167,9 @@ sparknlp/annotator/sentence/sentence_detector_dl.py,sha256=-Osj9Bm9KyZRTAWkOsK9c
|
|
|
167
167
|
sparknlp/annotator/sentiment/__init__.py,sha256=Lq3vKaZS1YATLMg0VNXSVtkWL5q5G9taGBvdrvSwnfg,766
|
|
168
168
|
sparknlp/annotator/sentiment/sentiment_detector.py,sha256=m545NGU0Xzg_PO6_qIfpli1uZj7JQcyFgqe9R6wAPFI,8154
|
|
169
169
|
sparknlp/annotator/sentiment/vivekn_sentiment.py,sha256=4rpXWDgzU6ddnbrSCp9VdLb2epCc9oZ3c6XcqxEw8nk,9655
|
|
170
|
-
sparknlp/annotator/seq2seq/__init__.py,sha256=
|
|
171
|
-
sparknlp/annotator/seq2seq/auto_gguf_model.py,sha256=
|
|
172
|
-
sparknlp/annotator/seq2seq/auto_gguf_vision_model.py,sha256=
|
|
170
|
+
sparknlp/annotator/seq2seq/__init__.py,sha256=Aj43G1MuQE0mW7LakCWPjiTkIGl7iHPAnKIwT_DfdIM,1781
|
|
171
|
+
sparknlp/annotator/seq2seq/auto_gguf_model.py,sha256=upwOpLteRWY0-Kp50aaQQTzRa2jylgJsAtvFRrWIULw,11758
|
|
172
|
+
sparknlp/annotator/seq2seq/auto_gguf_vision_model.py,sha256=F2tMQNA_bsKsXq_ohkdFKRnp5GdcbkQD0TEVSjnXBlc,15379
|
|
173
173
|
sparknlp/annotator/seq2seq/bart_transformer.py,sha256=I1flM4yeCzEAKOdQllBC30XuedxVJ7ferkFhZ6gwEbE,18481
|
|
174
174
|
sparknlp/annotator/seq2seq/cohere_transformer.py,sha256=43LZBVazZMgJRCsN7HaYjVYfJ5hRMV95QZyxMtXq-m4,13496
|
|
175
175
|
sparknlp/annotator/seq2seq/cpm_transformer.py,sha256=0CnBFMlxMu0pD2QZMHyoGtIYgXqfUQm68vr6zEAa6Eg,13290
|
|
@@ -183,6 +183,7 @@ sparknlp/annotator/seq2seq/nllb_transformer.py,sha256=1ys01yaC0nVzXETy8oD2wZHyom
|
|
|
183
183
|
sparknlp/annotator/seq2seq/olmo_transformer.py,sha256=B_zhYkAfYycw5uBq1tVNPmaKuYtpJOxRC6PArit7XiE,13634
|
|
184
184
|
sparknlp/annotator/seq2seq/phi2_transformer.py,sha256=WwKCUOH8qGFv62YF63HjuT7bMVldh06gHvaZH3tbSDk,13787
|
|
185
185
|
sparknlp/annotator/seq2seq/phi3_transformer.py,sha256=arIcw5NDMv3ubBwWz3KYRdLMsspTiEI8vk4s00lyq1c,14293
|
|
186
|
+
sparknlp/annotator/seq2seq/phi4_transformer.py,sha256=iVbsqIzKS2MG-LmA3tljjsjeCUzBqATw1btDBOnFviM,14324
|
|
186
187
|
sparknlp/annotator/seq2seq/qwen_transformer.py,sha256=IYxveoHGWWoiwzJ_VMLMgUBe6jr1JSHKSY0PApnTCOI,14640
|
|
187
188
|
sparknlp/annotator/seq2seq/starcoder_transformer.py,sha256=BTXbSMRpXnDvrfh-6iFS5k6g6EcPV9zBl4U-SSC19wA,14293
|
|
188
189
|
sparknlp/annotator/seq2seq/t5_transformer.py,sha256=wDVxNLluIU1HGZFqaKKc4YTt4l-elPlAtQ7EEa0f5tg,17308
|
|
@@ -222,12 +223,12 @@ sparknlp/common/annotator_properties.py,sha256=7B1os7pBUfHo6b7IPQAXQ-nir0u3tQLzD
|
|
|
222
223
|
sparknlp/common/annotator_type.py,sha256=ash2Ip1IOOiJamPVyy_XQj8Ja_DRHm0b9Vj4Ni75oKM,1225
|
|
223
224
|
sparknlp/common/coverage_result.py,sha256=No4PSh1HSs3PyRI1zC47x65tWgfirqPI290icHQoXEI,823
|
|
224
225
|
sparknlp/common/match_strategy.py,sha256=kt1MUPqU1wCwk5qCdYk6jubHbU-5yfAYxb9jjAOrdnY,1678
|
|
225
|
-
sparknlp/common/properties.py,sha256=
|
|
226
|
+
sparknlp/common/properties.py,sha256=7eBxODxKmFQAgOtrxUH9ly4LugUlkNRVXNQcM60AUK4,53025
|
|
226
227
|
sparknlp/common/read_as.py,sha256=imxPGwV7jr4Li_acbo0OAHHRGCBbYv-akzEGaBWEfcY,1226
|
|
227
228
|
sparknlp/common/recursive_annotator_approach.py,sha256=vqugBw22cE3Ff7PIpRlnYFuOlchgL0nM26D8j-NdpqU,1449
|
|
228
229
|
sparknlp/common/storage.py,sha256=D91H3p8EIjNspjqAYu6ephRpCUtdcAir4_PrAbkIQWE,4842
|
|
229
230
|
sparknlp/common/utils.py,sha256=Yne6yYcwKxhOZC-U4qfYoDhWUP_6BIaAjI5X_P_df1E,1306
|
|
230
|
-
sparknlp/internal/__init__.py,sha256=
|
|
231
|
+
sparknlp/internal/__init__.py,sha256=f5kxLz6bEX8FCMo6lek30MXbn_lDC-dBTI9s_fARblI,40748
|
|
231
232
|
sparknlp/internal/annotator_java_ml.py,sha256=UGPoThG0rGXUOXGSQnDzEDW81Mu1s5RPF29v7DFyE3c,1187
|
|
232
233
|
sparknlp/internal/annotator_transformer.py,sha256=fXmc2IWXGybqZpbEU9obmbdBYPc798y42zvSB4tqV9U,1448
|
|
233
234
|
sparknlp/internal/extended_java_wrapper.py,sha256=hwP0133-hDiDf5sBF-P3MtUsuuDj1PpQbtGZQIRwzfk,2240
|
|
@@ -246,7 +247,9 @@ sparknlp/pretrained/utils.py,sha256=T1MrvW_DaWk_jcOjVLOea0NMFE9w8fe0ZT_5urZ_nEY,
|
|
|
246
247
|
sparknlp/reader/__init__.py,sha256=-Toj3AIBki-zXPpV8ezFTI2LX1yP_rK2bhpoa8nBkTw,685
|
|
247
248
|
sparknlp/reader/enums.py,sha256=MNGug9oJ1BBLM1Pbske13kAabalDzHa2kucF5xzFpHs,770
|
|
248
249
|
sparknlp/reader/pdf_to_text.py,sha256=eWw-cwjosmcSZ9eHso0F5QQoeGBBnwsOhzhCXXvMjZA,7169
|
|
249
|
-
sparknlp/reader/
|
|
250
|
+
sparknlp/reader/reader2doc.py,sha256=LRqfaL9nidhlPkJIwTJo7SnGYmNNfOqwEdrsWYGEdnI,7146
|
|
251
|
+
sparknlp/reader/reader2table.py,sha256=GC6Yz0gQ83S6XKOi329TUNQuAvLrBxysqDkDRZPvcYA,4759
|
|
252
|
+
sparknlp/reader/sparknlp_reader.py,sha256=MJs8v_ECYaV1SOabI1L_2MkVYEDVImtwgbYypO7DJSY,20623
|
|
250
253
|
sparknlp/training/__init__.py,sha256=qREi9u-5Vc2VjpL6-XZsyvu5jSEIdIhowW7_kKaqMqo,852
|
|
251
254
|
sparknlp/training/conll.py,sha256=wKBiSTrjc6mjsl7Nyt6B8f4yXsDJkZb-sn8iOjix9cE,6961
|
|
252
255
|
sparknlp/training/conllu.py,sha256=8r3i-tmyrLsyk1DtZ9uo2mMDCWb1yw2Y5W6UsV13MkY,4953
|
|
@@ -277,7 +280,7 @@ sparknlp/training/_tf_graph_builders_1x/ner_dl/dataset_encoder.py,sha256=R4yHFN3
|
|
|
277
280
|
sparknlp/training/_tf_graph_builders_1x/ner_dl/ner_model.py,sha256=EoCSdcIjqQ3wv13MAuuWrKV8wyVBP0SbOEW41omHlR0,23189
|
|
278
281
|
sparknlp/training/_tf_graph_builders_1x/ner_dl/ner_model_saver.py,sha256=k5CQ7gKV6HZbZMB8cKLUJuZxoZWlP_DFWdZ--aIDwsc,2356
|
|
279
282
|
sparknlp/training/_tf_graph_builders_1x/ner_dl/sentence_grouper.py,sha256=pAxjWhjazSX8Vg0MFqJiuRVw1IbnQNSs-8Xp26L4nko,870
|
|
280
|
-
spark_nlp-6.
|
|
281
|
-
spark_nlp-6.
|
|
282
|
-
spark_nlp-6.
|
|
283
|
-
spark_nlp-6.
|
|
283
|
+
spark_nlp-6.1.1.dist-info/METADATA,sha256=OertmOupEEb_RIxRDn5V743bbzlD6lQr8RsGUWwYYtY,19774
|
|
284
|
+
spark_nlp-6.1.1.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
285
|
+
spark_nlp-6.1.1.dist-info/top_level.txt,sha256=uuytur4pyMRw2H_txNY2ZkaucZHUs22QF8-R03ch_-E,13
|
|
286
|
+
spark_nlp-6.1.1.dist-info/RECORD,,
|
sparknlp/__init__.py
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
"""Contains classes for the AutoGGUFEmbeddings."""
|
|
15
|
-
from typing import List
|
|
16
|
-
|
|
17
15
|
from sparknlp.common import *
|
|
18
16
|
|
|
19
17
|
|
|
@@ -32,7 +30,7 @@ class AutoGGUFEmbeddings(AnnotatorModel, HasBatchedAnnotate):
|
|
|
32
30
|
... .setInputCols(["document"]) \\
|
|
33
31
|
... .setOutputCol("embeddings")
|
|
34
32
|
|
|
35
|
-
The default model is ``"
|
|
33
|
+
The default model is ``"Qwen3_Embedding_0.6B_Q8_0_gguf"``, if no name is provided.
|
|
36
34
|
|
|
37
35
|
For extended examples of usage, see the
|
|
38
36
|
`AutoGGUFEmbeddingsTest <https://github.com/JohnSnowLabs/spark-nlp/tree/master/src/test/scala/com/johnsnowlabs/nlp/embeddings/AutoGGUFEmbeddingsTest.scala>`__
|
|
@@ -313,12 +311,6 @@ class AutoGGUFEmbeddings(AnnotatorModel, HasBatchedAnnotate):
|
|
|
313
311
|
"Set the pooling type for embeddings, use model default if unspecified",
|
|
314
312
|
typeConverter=TypeConverters.toString,
|
|
315
313
|
)
|
|
316
|
-
embedding = Param(
|
|
317
|
-
Params._dummy(),
|
|
318
|
-
"embedding",
|
|
319
|
-
"Whether to load model with embedding support",
|
|
320
|
-
typeConverter=TypeConverters.toBoolean,
|
|
321
|
-
)
|
|
322
314
|
flashAttention = Param(
|
|
323
315
|
Params._dummy(),
|
|
324
316
|
"flashAttention",
|
|
@@ -489,10 +481,10 @@ class AutoGGUFEmbeddings(AnnotatorModel, HasBatchedAnnotate):
|
|
|
489
481
|
classname=classname, java_model=java_model
|
|
490
482
|
)
|
|
491
483
|
self._setDefault(
|
|
492
|
-
embedding=True,
|
|
493
484
|
nCtx=4096,
|
|
494
485
|
nBatch=512,
|
|
495
486
|
poolingType="MEAN",
|
|
487
|
+
nGpuLayers=99,
|
|
496
488
|
)
|
|
497
489
|
|
|
498
490
|
@staticmethod
|
|
@@ -517,13 +509,13 @@ class AutoGGUFEmbeddings(AnnotatorModel, HasBatchedAnnotate):
|
|
|
517
509
|
return AutoGGUFEmbeddings(java_model=jModel)
|
|
518
510
|
|
|
519
511
|
@staticmethod
|
|
520
|
-
def pretrained(name="
|
|
512
|
+
def pretrained(name="Qwen3_Embedding_0.6B_Q8_0_gguf", lang="en", remote_loc=None):
|
|
521
513
|
"""Downloads and loads a pretrained model.
|
|
522
514
|
|
|
523
515
|
Parameters
|
|
524
516
|
----------
|
|
525
517
|
name : str, optional
|
|
526
|
-
Name of the pretrained model, by default "
|
|
518
|
+
Name of the pretrained model, by default "Qwen3_Embedding_0.6B_Q8_0_gguf"
|
|
527
519
|
lang : str, optional
|
|
528
520
|
Language of the pretrained model, by default "en"
|
|
529
521
|
remote_loc : str, optional
|
|
@@ -31,3 +31,4 @@ from sparknlp.annotator.seq2seq.starcoder_transformer import *
|
|
|
31
31
|
from sparknlp.annotator.seq2seq.llama3_transformer import *
|
|
32
32
|
from sparknlp.annotator.seq2seq.cohere_transformer import *
|
|
33
33
|
from sparknlp.annotator.seq2seq.olmo_transformer import *
|
|
34
|
+
from sparknlp.annotator.seq2seq.phi4_transformer import *
|
|
@@ -37,7 +37,11 @@ class AutoGGUFModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppProperties):
|
|
|
37
37
|
... .setInputCols(["document"]) \\
|
|
38
38
|
... .setOutputCol("completions")
|
|
39
39
|
|
|
40
|
-
The default model is ``"
|
|
40
|
+
The default model is ``"Phi_4_mini_instruct_Q4_K_M_gguf"``, if no name is provided.
|
|
41
|
+
|
|
42
|
+
AutoGGUFModel is also able to load pretrained models from AutoGGUFVisionModel. Just
|
|
43
|
+
specify the same name for the pretrained method, and it will load the text-part of the
|
|
44
|
+
multimodal model automatically.
|
|
41
45
|
|
|
42
46
|
For extended examples of usage, see the
|
|
43
47
|
`AutoGGUFModelTest <https://github.com/JohnSnowLabs/spark-nlp/tree/master/src/test/scala/com/johnsnowlabs/nlp/annotators/seq2seq/AutoGGUFModelTest.scala>`__
|
|
@@ -120,8 +124,6 @@ class AutoGGUFModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppProperties):
|
|
|
120
124
|
Set path to static lookup cache to use for lookup decoding (not updated by generation)
|
|
121
125
|
lookupCacheDynamicFilePath
|
|
122
126
|
Set path to dynamic lookup cache to use for lookup decoding (updated by generation)
|
|
123
|
-
embedding
|
|
124
|
-
Whether to load model with embedding support
|
|
125
127
|
flashAttention
|
|
126
128
|
Whether to enable Flash Attention
|
|
127
129
|
inputPrefixBos
|
|
@@ -252,8 +254,9 @@ class AutoGGUFModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppProperties):
|
|
|
252
254
|
useChatTemplate=True,
|
|
253
255
|
nCtx=4096,
|
|
254
256
|
nBatch=512,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
nPredict=100,
|
|
258
|
+
nGpuLayers=99,
|
|
259
|
+
systemPrompt="You are a helpful assistant."
|
|
257
260
|
)
|
|
258
261
|
|
|
259
262
|
@staticmethod
|
|
@@ -277,13 +280,13 @@ class AutoGGUFModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppProperties):
|
|
|
277
280
|
return AutoGGUFModel(java_model=jModel)
|
|
278
281
|
|
|
279
282
|
@staticmethod
|
|
280
|
-
def pretrained(name="
|
|
283
|
+
def pretrained(name="Phi_4_mini_instruct_Q4_K_M_gguf", lang="en", remote_loc=None):
|
|
281
284
|
"""Downloads and loads a pretrained model.
|
|
282
285
|
|
|
283
286
|
Parameters
|
|
284
287
|
----------
|
|
285
288
|
name : str, optional
|
|
286
|
-
Name of the pretrained model, by default "
|
|
289
|
+
Name of the pretrained model, by default "Phi_4_mini_instruct_Q4_K_M_gguf"
|
|
287
290
|
lang : str, optional
|
|
288
291
|
Language of the pretrained model, by default "en"
|
|
289
292
|
remote_loc : str, optional
|
|
@@ -43,7 +43,7 @@ class AutoGGUFVisionModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppPropert
|
|
|
43
43
|
.setOutputCol("completions")
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
The default model is ``"
|
|
46
|
+
The default model is ``"Qwen2.5_VL_3B_Instruct_Q4_K_M_gguf"``, if no name is provided.
|
|
47
47
|
|
|
48
48
|
For available pretrained models please see the `Models Hub <https://sparknlp.org/models>`__.
|
|
49
49
|
|
|
@@ -311,13 +311,13 @@ class AutoGGUFVisionModel(AnnotatorModel, HasBatchedAnnotate, HasLlamaCppPropert
|
|
|
311
311
|
return AutoGGUFVisionModel(java_model=jModel)
|
|
312
312
|
|
|
313
313
|
@staticmethod
|
|
314
|
-
def pretrained(name="
|
|
314
|
+
def pretrained(name="Qwen2.5_VL_3B_Instruct_Q4_K_M_gguf", lang="en", remote_loc=None):
|
|
315
315
|
"""Downloads and loads a pretrained model.
|
|
316
316
|
|
|
317
317
|
Parameters
|
|
318
318
|
----------
|
|
319
319
|
name : str, optional
|
|
320
|
-
Name of the pretrained model, by default "
|
|
320
|
+
Name of the pretrained model, by default "Qwen2.5_VL_3B_Instruct_Q4_K_M_gguf"
|
|
321
321
|
lang : str, optional
|
|
322
322
|
Language of the pretrained model, by default "en"
|
|
323
323
|
remote_loc : str, optional
|