Update README.md
Browse files
README.md
CHANGED
|
@@ -3,28 +3,31 @@ license: cc-by-sa-4.0
|
|
| 3 |
inference: false
|
| 4 |
---
|
| 5 |
|
| 6 |
-
# SLIM-
|
| 7 |
|
| 8 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
| 10 |
-
**slim-
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
This model is fine-tuned on top of [**llmware/bling-stable-lm-3b-4e1t-v0**](https://huggingface.co/llmware/bling-stable-lm-3b-4e1t-v0), which in turn, is a fine-tune of stabilityai/stablelm-3b-4elt.
|
| 20 |
|
| 21 |
-
Each slim model has a 'quantized tool' version, e.g., [**'slim-
|
| 22 |
|
| 23 |
|
| 24 |
## Prompt format:
|
| 25 |
|
| 26 |
`function = "classify"`
|
| 27 |
-
`params = "
|
| 28 |
`prompt = "<human> " + {text} + "\n" + `
|
| 29 |
`"<{function}> " + {params} + "</{function}>" + "\n<bot>:"`
|
| 30 |
|
|
@@ -32,8 +35,8 @@ Each slim model has a 'quantized tool' version, e.g., [**'slim-sa-ner-3b-tool'*
|
|
| 32 |
<details>
|
| 33 |
<summary>Transformers Script </summary>
|
| 34 |
|
| 35 |
-
model = AutoModelForCausalLM.from_pretrained("llmware/slim-
|
| 36 |
-
tokenizer = AutoTokenizer.from_pretrained("llmware/slim-
|
| 37 |
|
| 38 |
function = "classify"
|
| 39 |
params = "topic"
|
|
@@ -75,8 +78,8 @@ Each slim model has a 'quantized tool' version, e.g., [**'slim-sa-ner-3b-tool'*
|
|
| 75 |
<summary>Using as Function Call in LLMWare</summary>
|
| 76 |
|
| 77 |
from llmware.models import ModelCatalog
|
| 78 |
-
slim_model = ModelCatalog().load_model("llmware/slim-
|
| 79 |
-
response = slim_model.function_call(text,params=["
|
| 80 |
|
| 81 |
print("llmware - llm_response: ", response)
|
| 82 |
|
|
|
|
| 3 |
inference: false
|
| 4 |
---
|
| 5 |
|
| 6 |
+
# SLIM-TAGS-3B
|
| 7 |
|
| 8 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
| 10 |
+
**slim-tags-3b** is a small, specialized function-calling model fine-tuned to extract and generate meaningful tags from a chunk of text.
|
| 11 |
|
| 12 |
+
Tags generally correspond with a 'wide' interpretation of named entities, but will also include key objects, entities and phrases that contribute meaningfully to the semantic meaning of the text.
|
| 13 |
|
| 14 |
+
The model is invoked as a specialized 'tags' classifier function that outputs a python dictionary in the form of:
|
| 15 |
|
| 16 |
+
`{'tags': ['NASDAQ', 'S&P', 'Dow', 'Verizon', 'Netflix, ... ']}`
|
| 17 |
|
| 18 |
+
with the value items in the list generally being extracted from the source text.
|
| 19 |
+
|
| 20 |
+
The intended use of the model is to auto-generate tags to text that can be used to enhance search retrieval, categorization, or to extract named entities that can be used programmatically in follow-up queries or prompts. It can also be used for fact-checking as a secondary validation on a longer (separate) LLM output.
|
| 21 |
|
| 22 |
This model is fine-tuned on top of [**llmware/bling-stable-lm-3b-4e1t-v0**](https://huggingface.co/llmware/bling-stable-lm-3b-4e1t-v0), which in turn, is a fine-tune of stabilityai/stablelm-3b-4elt.
|
| 23 |
|
| 24 |
+
Each slim model has a 'quantized tool' version, e.g., [**'slim-tags-3b-tool'**](https://huggingface.co/llmware/slim-tags-3b-tool).
|
| 25 |
|
| 26 |
|
| 27 |
## Prompt format:
|
| 28 |
|
| 29 |
`function = "classify"`
|
| 30 |
+
`params = "tags"`
|
| 31 |
`prompt = "<human> " + {text} + "\n" + `
|
| 32 |
`"<{function}> " + {params} + "</{function}>" + "\n<bot>:"`
|
| 33 |
|
|
|
|
| 35 |
<details>
|
| 36 |
<summary>Transformers Script </summary>
|
| 37 |
|
| 38 |
+
model = AutoModelForCausalLM.from_pretrained("llmware/slim-tags-3b")
|
| 39 |
+
tokenizer = AutoTokenizer.from_pretrained("llmware/slim-tags-3b")
|
| 40 |
|
| 41 |
function = "classify"
|
| 42 |
params = "topic"
|
|
|
|
| 78 |
<summary>Using as Function Call in LLMWare</summary>
|
| 79 |
|
| 80 |
from llmware.models import ModelCatalog
|
| 81 |
+
slim_model = ModelCatalog().load_model("llmware/slim-tags-3b")
|
| 82 |
+
response = slim_model.function_call(text,params=["tags"], function="classify")
|
| 83 |
|
| 84 |
print("llmware - llm_response: ", response)
|
| 85 |
|