Update README.md
Browse files
README.md
CHANGED
|
@@ -3,28 +3,26 @@ 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 |
-
This 'combo' model is designed to illustrate the potential power of using function calls on small, specialized models to enable a single model architecture to combine the capabilities of what were traditionally two separate model architectures on an encoder.
|
| 15 |
|
| 16 |
The intent of SLIMs is to forge a middle-ground between traditional encoder-based classifiers and open-ended API-based LLMs, providing an intuitive, flexible natural language response, without complex prompting, and with improved generalization and ability to fine-tune to a specific domain use case.
|
| 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,11 +30,11 @@ 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 = "
|
| 40 |
|
| 41 |
text = "Tesla stock declined yesterday 8% in premarket trading after a poorly-received event in San Francisco yesterday, in which the company indicated a likely shortfall in revenue."
|
| 42 |
|
|
@@ -75,8 +73,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-XSUM
|
| 7 |
|
| 8 |
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
| 10 |
+
**slim-xsum** implements an 'extreme summarization' function as a function-call on a decoder-based LLM, which generates as output a python dictionary with the form of:
|
| 11 |
|
| 12 |
+
`{'xsum': ['This is a short text summary or headline.']}`
|
| 13 |
|
|
|
|
| 14 |
|
| 15 |
The intent of SLIMs is to forge a middle-ground between traditional encoder-based classifiers and open-ended API-based LLMs, providing an intuitive, flexible natural language response, without complex prompting, and with improved generalization and ability to fine-tune to a specific domain use case.
|
| 16 |
|
|
|
|
| 17 |
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.
|
| 18 |
|
| 19 |
+
Each slim model has a 'quantized tool' version, e.g., [**'slim-xsum-tool'**](https://huggingface.co/llmware/slim-xsum-tool).
|
| 20 |
|
| 21 |
|
| 22 |
## Prompt format:
|
| 23 |
|
| 24 |
`function = "classify"`
|
| 25 |
+
`params = "xsum"`
|
| 26 |
`prompt = "<human> " + {text} + "\n" + `
|
| 27 |
`"<{function}> " + {params} + "</{function}>" + "\n<bot>:"`
|
| 28 |
|
|
|
|
| 30 |
<details>
|
| 31 |
<summary>Transformers Script </summary>
|
| 32 |
|
| 33 |
+
model = AutoModelForCausalLM.from_pretrained("llmware/slim-xsum")
|
| 34 |
+
tokenizer = AutoTokenizer.from_pretrained("llmware/slim-xsum")
|
| 35 |
|
| 36 |
function = "classify"
|
| 37 |
+
params = "xsum"
|
| 38 |
|
| 39 |
text = "Tesla stock declined yesterday 8% in premarket trading after a poorly-received event in San Francisco yesterday, in which the company indicated a likely shortfall in revenue."
|
| 40 |
|
|
|
|
| 73 |
<summary>Using as Function Call in LLMWare</summary>
|
| 74 |
|
| 75 |
from llmware.models import ModelCatalog
|
| 76 |
+
slim_model = ModelCatalog().load_model("llmware/slim-xsum")
|
| 77 |
+
response = slim_model.function_call(text,params=["xsum"], function="classify")
|
| 78 |
|
| 79 |
print("llmware - llm_response: ", response)
|
| 80 |
|