You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,18 @@ Together let's build more useful models.
17
17
18
18
## 🚀 Features
19
19
- One line to build any classifier that you don't have data 🤯
20
-
- Why one line? Because it can easily be used by other LLM as a function call, easily to be integrated with any **agentic flow**
20
+
- Why one line? Not only it is easy to be used by Human but also it can easily be used by other LLM as a function call, easily to be integrated with any **agentic flow**
21
21
- Smoothness integration with transformers, setfit, fasttext and datasets
22
22
-[setfit](https://github.com/huggingface/setfit): for limited data (e.g. 100) 🤗
23
23
-[fastText](https://github.com/facebookresearch/fastText): for blazingly fast inference (1000 docs/s) without GPU ⚡️
24
24
-[transformers](https://github.com/huggingface/transformers): for other usecase
25
25
- Huggingface-like interface for fastText that supports push_to_hub, saving and loading (let's not forget this amazing model before transformers architecture).
26
26
27
27
## 🏁 QuickStart in Colab
28
-
[](https://colab.research.google.com/drive/1LB8PUTT9wM1Qb2cY-6Dx-RNiqmyCvRr1?usp=sharing)
| imdb sentiment classification |[](https://colab.research.google.com/drive/1LB8PUTT9wM1Qb2cY-6Dx-RNiqmyCvRr1?usp=sharing)|
31
+
29
32
30
33
## 🔧 Installation
31
34
It is using llama.cpp as backend, and build wheel can take a lot of time (10min+), as such, we also provide an instruction to install with pre-built wheel.
@@ -82,11 +85,11 @@ unlabeled_dataset # a huggingface datasets.Dataset class can be from your local
82
85
# Magic One Line!
83
86
trainer = build_anyclassifier(
84
87
"Classify a text's sentiment.",
85
-
hf_hub_download("lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF", "Meta-Llama-3.1-8B-Instruct-Q8_0.gguf"), # as you like
86
88
[
87
89
Label(name='1', desc='positive sentiment'),
88
90
Label(name='0', desc='negative sentiment')
89
91
],
92
+
hf_hub_download("lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF", "Meta-Llama-3.1-8B-Instruct-Q8_0.gguf"), # as you like
| fasttext |[link](examples/train_fasttext_model.py)|[link](https://huggingface.co/kenhktsui/fasttext_test)(probably need more label) |[link](https://huggingface.co/datasets/kenhktsui/anyclassifier_dataset_demo)|
Copy file name to clipboardExpand all lines: anyclassifier/annotation/annotator.py
+15-8Lines changed: 15 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,29 +1,33 @@
1
1
importsys
2
2
fromabcimportabstractmethod, ABCMeta
3
-
fromtypingimportUnion, Optional
3
+
fromtypingimportUnion, Optional, List
4
4
importre
5
5
fromcollectionsimportCounter
6
6
fromtqdmimporttqdm
7
7
importlogging
8
8
fromllama_cppimportLlama
9
9
fromdatasetsimportDataset# it is import to load llama_cpp first before datasets to prevent error like https://github.com/abetlen/llama-cpp-python/issues/806
0 commit comments