walaa2022 commited on
Commit
37d8fd3
·
verified ·
1 Parent(s): da9c941

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -38,10 +38,10 @@ class FinancialAnalyzer:
38
  # 1. Llama 2 for strategic analysis
39
  self.strategic_analyzer = pipeline(
40
  "text-generation",
41
- model="meta-llama/Llama-2-7b-chat-hf",
42
  device_map="auto"
43
  )
44
- logger.info("Llama 2 initialized successfully")
45
 
46
  # 2. FinBERT for financial sentiment
47
  self.financial_analyzer = pipeline(
@@ -74,13 +74,11 @@ class FinancialAnalyzer:
74
  raise
75
 
76
  def generate_strategic_analysis(self, financial_data):
77
- """Generate strategic analysis using Llama 2"""
78
  try:
79
  prompt = f"""[INST] As a senior financial analyst, analyze these financial statements:
80
-
81
  Financial Data:
82
  {financial_data}
83
-
84
  Provide:
85
  1. Business Health Assessment
86
  2. Key Strategic Insights
@@ -165,7 +163,6 @@ def analyze_financial_statements(income_statement, balance_sheet):
165
 
166
  Please check:
167
  Files are in correct CSV format & contain the expected data
168
-
169
  If the problem persists, try uploading the files again."""
170
 
171
  def format_results(analysis, sentiment, recommendations):
@@ -202,7 +199,7 @@ iface = gr.Interface(
202
  outputs=gr.Markdown(),
203
  title="AI-Powered Financial Statement Analysis",
204
  description="""Upload your financial statements for comprehensive analysis using:
205
- - Llama 2: Strategic Analysis
206
  - FinBERT: Financial Sentiment Analysis
207
  - Falcon: Strategic Recommendations""",
208
  examples=[
 
38
  # 1. Llama 2 for strategic analysis
39
  self.strategic_analyzer = pipeline(
40
  "text-generation",
41
+ model="meta-llama/Llama-3.2-1B",
42
  device_map="auto"
43
  )
44
+ logger.info("Llama 3 initialized successfully")
45
 
46
  # 2. FinBERT for financial sentiment
47
  self.financial_analyzer = pipeline(
 
74
  raise
75
 
76
  def generate_strategic_analysis(self, financial_data):
77
+ """Generate strategic analysis using Llama 3"""
78
  try:
79
  prompt = f"""[INST] As a senior financial analyst, analyze these financial statements:
 
80
  Financial Data:
81
  {financial_data}
 
82
  Provide:
83
  1. Business Health Assessment
84
  2. Key Strategic Insights
 
163
 
164
  Please check:
165
  Files are in correct CSV format & contain the expected data
 
166
  If the problem persists, try uploading the files again."""
167
 
168
  def format_results(analysis, sentiment, recommendations):
 
199
  outputs=gr.Markdown(),
200
  title="AI-Powered Financial Statement Analysis",
201
  description="""Upload your financial statements for comprehensive analysis using:
202
+ - Llama 3: Strategic Analysis
203
  - FinBERT: Financial Sentiment Analysis
204
  - Falcon: Strategic Recommendations""",
205
  examples=[