Josephgflowers/Finance-Instruct-500k
Viewer • Updated • 518k • 1.42k • 228
How to use shah-shazid-askary/amd-finance-llm with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="shah-shazid-askary/amd-finance-llm") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("shah-shazid-askary/amd-finance-llm", dtype="auto")How to use shah-shazid-askary/amd-finance-llm with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shah-shazid-askary/amd-finance-llm"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shah-shazid-askary/amd-finance-llm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/shah-shazid-askary/amd-finance-llm
How to use shah-shazid-askary/amd-finance-llm with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "shah-shazid-askary/amd-finance-llm" \
--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": "shah-shazid-askary/amd-finance-llm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "shah-shazid-askary/amd-finance-llm" \
--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": "shah-shazid-askary/amd-finance-llm",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use shah-shazid-askary/amd-finance-llm with Docker Model Runner:
docker model run hf.co/shah-shazid-askary/amd-finance-llm
Domain-specific large language model fine-tuned for finance, optimized for AMD Instinct MI300X GPUs via ROCm.
Derived from ODA-Fin (arXiv:2603.07223) + Fin-R1 (arXiv:2503.16252):
| Hyperparameter | Value |
|---|---|
| Learning rate | 1e-5 (cosine, 10% warmup) |
| Epochs | 3 |
| Batch size | 1 × 16 grad accum |
| Sequence length | 8192 |
| Precision | bfloat16 |
| Attention | Flash Attention 2 (CK backend) |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("shah-shazid-askary/amd-finance-llm")
tokenizer = AutoTokenizer.from_pretrained("shah-shazid-askary/amd-finance-llm")
messages = [{"role": "user", "content": "What is a P/E ratio?"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.