Text Generation
Transformers
Safetensors
English
llama
finance
financial-sentiment
sentiment-analysis
chain-of-thought
reasoning
grpo
sft
lora
finsenti
conversational
text-generation-inference
Instructions to use Ayansk11/FinSenti-Tiny-LLM-10M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ayansk11/FinSenti-Tiny-LLM-10M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ayansk11/FinSenti-Tiny-LLM-10M") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ayansk11/FinSenti-Tiny-LLM-10M") model = AutoModelForCausalLM.from_pretrained("Ayansk11/FinSenti-Tiny-LLM-10M", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ayansk11/FinSenti-Tiny-LLM-10M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ayansk11/FinSenti-Tiny-LLM-10M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ayansk11/FinSenti-Tiny-LLM-10M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ayansk11/FinSenti-Tiny-LLM-10M
- SGLang
How to use Ayansk11/FinSenti-Tiny-LLM-10M 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 "Ayansk11/FinSenti-Tiny-LLM-10M" \ --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": "Ayansk11/FinSenti-Tiny-LLM-10M", "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 "Ayansk11/FinSenti-Tiny-LLM-10M" \ --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": "Ayansk11/FinSenti-Tiny-LLM-10M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Ayansk11/FinSenti-Tiny-LLM-10M with Docker Model Runner:
docker model run hf.co/Ayansk11/FinSenti-Tiny-LLM-10M
Upload folder using huggingface_hub
Browse files- chat_template.jinja +8 -2
- config.json +2 -2
- generation_config.json +4 -1
- model.safetensors +1 -1
chat_template.jinja
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
-
{% for message in messages %}
|
|
|
|
| 2 |
|
| 3 |
-
{
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
{% endif %}
|
|
|
|
| 1 |
+
{% for message in messages %}{% if message['role'] == 'system' %}### System
|
| 2 |
+
{{ message['content'] }}
|
| 3 |
|
| 4 |
+
{% elif message['role'] == 'user' %}### Input
|
| 5 |
+
{{ message['content'] }}
|
| 6 |
|
| 7 |
+
{% elif message['role'] == 'assistant' %}### Response
|
| 8 |
+
{{ message['content'] }}{{ eos_token }}
|
| 9 |
+
|
| 10 |
+
{% endif %}{% endfor %}{% if add_generation_prompt %}### Response
|
| 11 |
{% endif %}
|
config.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"num_attention_heads": 2,
|
| 19 |
"num_hidden_layers": 1,
|
| 20 |
"num_key_value_heads": 1,
|
| 21 |
-
"pad_token_id":
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
"rms_norm_eps": 1e-05,
|
| 24 |
"rope_parameters": {
|
|
@@ -27,6 +27,6 @@
|
|
| 27 |
},
|
| 28 |
"tie_word_embeddings": false,
|
| 29 |
"transformers_version": "5.2.0",
|
| 30 |
-
"use_cache":
|
| 31 |
"vocab_size": 32001
|
| 32 |
}
|
|
|
|
| 18 |
"num_attention_heads": 2,
|
| 19 |
"num_hidden_layers": 1,
|
| 20 |
"num_key_value_heads": 1,
|
| 21 |
+
"pad_token_id": 32000,
|
| 22 |
"pretraining_tp": 1,
|
| 23 |
"rms_norm_eps": 1e-05,
|
| 24 |
"rope_parameters": {
|
|
|
|
| 27 |
},
|
| 28 |
"tie_word_embeddings": false,
|
| 29 |
"transformers_version": "5.2.0",
|
| 30 |
+
"use_cache": false,
|
| 31 |
"vocab_size": 32001
|
| 32 |
}
|
generation_config.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
-
"eos_token_id":
|
|
|
|
|
|
|
|
|
|
| 5 |
"tie_word_embeddings": false,
|
| 6 |
"transformers_version": "5.2.0",
|
| 7 |
"use_cache": true
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
2
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 32000,
|
| 8 |
"tie_word_embeddings": false,
|
| 9 |
"transformers_version": "5.2.0",
|
| 10 |
"use_cache": true
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 25980048
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aaa18c0d8276b37da5779089b1b3b24a0041f345b2594216e4390aa5438f8161
|
| 3 |
size 25980048
|