Instructions to use llmware/slim-emotions with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llmware/slim-emotions with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="llmware/slim-emotions")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("llmware/slim-emotions") model = AutoModelForCausalLM.from_pretrained("llmware/slim-emotions", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use llmware/slim-emotions with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "llmware/slim-emotions" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/slim-emotions", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/llmware/slim-emotions
- SGLang
How to use llmware/slim-emotions with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "llmware/slim-emotions" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/slim-emotions", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "llmware/slim-emotions" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/slim-emotions", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use llmware/slim-emotions with Docker Model Runner:
docker model run hf.co/llmware/slim-emotions
Update README.md
Browse files6 unmodified lines789101112131415161718192021222324252627281 unmodified line303132333435363738394032 unmodified lines73747576777879806 unmodified lines<!-- Provide a quick summary of what the model is/does. -->**slim-sentiment** is part of the SLIM ("**S**tructured **L**anguage **I**nstruction **M**odel") model series, consisting of small, specialized decoder-based models, fine-tuned for function-calling.slim-sentiment has been fine-tuned for **sentiment analysis** function calls, generating output consisting of a python dictionary corresponding to specified keys, e.g.: `{"sentiment": ["positive"]}`SLIM models are designed to provide a flexible natural language generative model that can be used as part of a multi-step, multi-model LLM-based automation workflow.Each slim model has a 'quantized tool' version, e.g., [**'slim-sentiment-tool'**](https://huggingface.co/llmware/slim-sentiment-tool).## Prompt format:`function = "classify"``params = "sentiment"``prompt = "<human> " + {text} + "\n" + ` `"<{function}> " + {params} + "</{function}>" + "\n<bot>:"`1 unmodified line<details><summary>Transformers Script </summary>model = AutoModelForCausalLM.from_pretrained("llmware/slim-sentiment")tokenizer = AutoTokenizer.from_pretrained("llmware/slim-sentiment")function = "classify"params = "sentiment"text = "The stock market declined yesterday as investors worried increasingly about the slowing economy."32 unmodified lines<summary>Using as Function Call in LLMWare</summary>from llmware.models import ModelCatalogslim_model = ModelCatalog().load_model("llmware/slim-sentiment")response = slim_model.function_call(text,params=["sentiment"], function="classify")print("llmware - llm_response: ", response)6 unmodified lines789101112131415161718192021222324252627281 unmodified line303132333435363738394032 unmodified lines73747576777879806 unmodified lines<!-- Provide a quick summary of what the model is/does. -->**slim-emotions** is part of the SLIM ("**S**tructured **L**anguage **I**nstruction **M**odel") model series, consisting of small, specialized decoder-based models, fine-tuned for function-calling.slim-emotions has been fine-tuned for **emotion analysis** function calls, generating output consisting of a python dictionary corresponding to specified keys, e.g.: `{"emotion": ["proud"]}`SLIM models are designed to provide a flexible natural language generative model that can be used as part of a multi-step, multi-model LLM-based automation workflow.Each slim model has a 'quantized tool' version, e.g., [**'slim-emotions-tool'**](https://huggingface.co/llmware/slim-emotions-tool).## Prompt format:`function = "classify"``params = "emotions"``prompt = "<human> " + {text} + "\n" + ` `"<{function}> " + {params} + "</{function}>" + "\n<bot>:"`1 unmodified line<details><summary>Transformers Script </summary>model = AutoModelForCausalLM.from_pretrained("llmware/slim-emotions")tokenizer = AutoTokenizer.from_pretrained("llmware/slim-emotions")function = "classify"params = "emotions"text = "The stock market declined yesterday as investors worried increasingly about the slowing economy."32 unmodified lines<summary>Using as Function Call in LLMWare</summary>from llmware.models import ModelCatalogslim_model = ModelCatalog().load_model("llmware/slim-emotions")response = slim_model.function_call(text,params=["emotions"], function="classify")print("llmware - llm_response: ", response)
README.md+10-10