Instructions to use tunedtensor/qwen3.5-2b-financial-sentiment with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tunedtensor/qwen3.5-2b-financial-sentiment with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tunedtensor/qwen3.5-2b-financial-sentiment") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("tunedtensor/qwen3.5-2b-financial-sentiment") model = AutoModelForMultimodalLM.from_pretrained("tunedtensor/qwen3.5-2b-financial-sentiment") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tunedtensor/qwen3.5-2b-financial-sentiment with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tunedtensor/qwen3.5-2b-financial-sentiment" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tunedtensor/qwen3.5-2b-financial-sentiment", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tunedtensor/qwen3.5-2b-financial-sentiment
- SGLang
How to use tunedtensor/qwen3.5-2b-financial-sentiment 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 "tunedtensor/qwen3.5-2b-financial-sentiment" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tunedtensor/qwen3.5-2b-financial-sentiment", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "tunedtensor/qwen3.5-2b-financial-sentiment" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tunedtensor/qwen3.5-2b-financial-sentiment", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tunedtensor/qwen3.5-2b-financial-sentiment with Docker Model Runner:
docker model run hf.co/tunedtensor/qwen3.5-2b-financial-sentiment
Qwen3.5-2B Financial Sentiment Extractor
This model is a Tuned Tensor fine-tune of Qwen/Qwen3.5-2B for extracting a structured market sentiment signal from finance-related tweets and social posts.
Given one post, it returns compact JSON:
{"sentiment":"bearish","label":0,"rationale":"The post expresses a bearish market signal."}
Label mapping:
0: bearish1: bullish2: neutral
Training
- Base model:
Qwen/Qwen3.5-2B - Training dataset:
zeroshot/twitter-financial-news-sentiment - Dataset license: MIT
- Base model license: Apache-2.0
- Tuned Tensor run ID:
61d64e3e-b9a1-48e5-8803-c7c30a4df5a8 - Tuned Tensor model ID:
fd09ae23-1935-48b4-b838-9e563df59b49 - Training rows used by trainer:
4,080 - Precision:
bf16 - Epochs:
1 - Final reported training loss:
0.5898758276
The source dataset was converted into strict input / output supervised rows with balanced labels. The behavior spec used during training is included as tunedtensor.json.
Evaluation
Tuned Tensor LLM-judge evaluation, capped at 120 examples per split:
| Split | Base avg score | Tuned avg score | Delta | Base pass rate | Tuned pass rate | Delta |
|---|---|---|---|---|---|---|
| Validation | 0.819 | 0.903 | +0.084 | 79.2% | 86.7% | +7.5 pp |
| Test | 0.834 | 0.875 | +0.041 | 80.0% | 85.8% | +5.8 pp |
Output format diagnostics:
- Valid JSON: 100%
- Strict JSON: 100%
- Expected schema keys: 100%
- Non-JSON prefix: 0%
Local hand-curated smoke tests are included:
local_real_tests_fd09ae23.jsonlocal_real_tests_fd09ae23_batch2.json
Usage
The model was locally served and tested with Tuned Tensor's OpenAI-compatible serving runtime:
tt models serve fd09ae23-1935-48b4-b838-9e563df59b49 \
--spec tunedtensor.json \
--device auto \
--temperature 0 \
--max-tokens 96
Example prompt:
Extract the market sentiment signal from this finance-related social post. Return only strict JSON with exactly these keys: sentiment, label, rationale. sentiment must be one of bearish, bullish, neutral; label must be one of 0, 1, 2.
Post: $NVDA shares jump after analysts raise price targets on stronger AI chip demand.
Expected response shape:
{"sentiment":"bullish","label":1,"rationale":"The post expresses a bullish market signal."}
Limitations
This model classifies short market-social posts into coarse sentiment categories. It is not an investment advisor, trading system, or factual market-data source.
Known caveat from evaluation: some ambiguous mixed-signal posts may still be difficult, especially when a post contains both a clearly negative primary event and a secondary contrarian or factual framing.
- Downloads last month
- -