Instructions to use masahiroid/Sentiment-Analysis-7B-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use masahiroid/Sentiment-Analysis-7B-4bit-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("masahiroid/Sentiment-Analysis-7B-4bit-mlx") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use masahiroid/Sentiment-Analysis-7B-4bit-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "masahiroid/Sentiment-Analysis-7B-4bit-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "masahiroid/Sentiment-Analysis-7B-4bit-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "masahiroid/Sentiment-Analysis-7B-4bit-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
File size: 1,404 Bytes
7b3a700 7b4ba1c 7b3a700 7b4ba1c 7b3a700 7b4ba1c 7b3a700 7b4ba1c 7b3a700 7b4ba1c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ---
license: mit
library_name: mlx
pipeline_tag: text-generation
base_model: microsoft/Sentiment-Analysis-7B
tags:
- mlx
- 4bit
---
# Sentiment-Analysis-7B-4bit-mlx
[日本語版はこちら (README.ja.md)](README.ja.md)
An unofficial 4-bit MLX conversion of [`microsoft/Sentiment-Analysis-7B`](https://huggingface.co/microsoft/Sentiment-Analysis-7B) for Apple Silicon Macs (sized for 16GB unified memory). All credit goes to the original authors.
- Parameters: 7.24B / License: mit (same as the base model)
## Usage
```bash
pip install -U mlx-lm
mlx_lm.generate --model masahiroid/Sentiment-Analysis-7B-4bit-mlx --prompt "日本の首都はどこですか?" --max-tokens 256
```
```python
from mlx_lm import load, generate
model, tokenizer = load("masahiroid/Sentiment-Analysis-7B-4bit-mlx")
messages = [{"role": "user", "content": "日本の首都はどこですか?"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt=prompt, max_tokens=256))
```
## Security
Audited with [model-audit-lite](https://github.com/masahiroid/model-audit-lite) before publication:
- File checks (pickle-format weights, bundled custom code, SHA256)
- Chat template identical before and after conversion
- Japanese safety probes (on the converted model)
See [SECURITY.md](SECURITY.md) and [audit/report.md](audit/report.md) for the results.
|