FinGPT/fingpt-forecaster-dow30-202305-202405
Viewer β’ Updated β’ 1.53k β’ 343 β’ 18
How to use Mahendra1742/FinancialGPT with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("summarization", model="Mahendra1742/FinancialGPT") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Mahendra1742/FinancialGPT", dtype="auto")FinancialGPT is a small, domain-adapted language model fine-tuned on real financial forecast data to replicate ideas from FinGPT on consumer hardware.
Goal: Fine-tune an open-source LLM to generate earnings outlooks for Dow30 companies using modern parameter-efficient methods.
FinGPT/fingpt-forecaster-dow30-202305-202405from transformers import AutoModelForCausalLM, AutoTokenizer
# Replace with your actual repo!
model_name = "Mahendra1742/FinancialGPT"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
prompt = """Company: TSLA
Period: 2024-09
Prompt: What is the market sentiment for Tesla's earnings next quarter?
Answer:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=100,
temperature=0.7,
do_sample=True,
top_p=0.9
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Below is a realistic example showing the intended model behavior:
Company: AAPL
Period: 2024-09
Prompt: Provide a detailed market sentiment analysis for Apple's earnings forecast next quarter.
Answer: Analysts expect Apple to report steady revenue growth driven by strong iPhone sales and growth in services. Market sentiment remains positive, with a projected earnings per share increase of around 6% year-over-year.
Base model
EleutherAI/pythia-410m