Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -331,7 +331,7 @@ Provide:
|
|
331 |
recommendations.append("- Develop strategies to accelerate revenue growth")
|
332 |
recommendations.append("- Consider strategic acquisitions or new market entry")
|
333 |
|
334 |
-
|
335 |
|
336 |
def analyze_financials(self, balance_sheet_file, income_stmt_file):
|
337 |
"""Main analysis function"""
|
@@ -391,7 +391,7 @@ Provide:
|
|
391 |
return f"Error in analysis: {str(e)}\n\nDetails: {type(e).__name__}"
|
392 |
|
393 |
def fine_tune_models(self, train_texts, train_labels, epochs=3):
|
394 |
-
|
395 |
try:
|
396 |
# Prepare dataset
|
397 |
train_dataset = FinancialDataset(train_texts, train_labels, self.llama_tokenizer)
|
@@ -412,9 +412,9 @@ Provide:
|
|
412 |
|
413 |
# Initialize trainer
|
414 |
trainer = Trainer(
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
)
|
419 |
|
420 |
# Fine-tune the model
|
@@ -429,7 +429,6 @@ Provide:
|
|
429 |
print(f"Error in fine-tuning: {str(e)}")
|
430 |
|
431 |
|
432 |
-
|
433 |
def create_interface():
|
434 |
analyzer = FinancialAnalyzer()
|
435 |
|
|
|
331 |
recommendations.append("- Develop strategies to accelerate revenue growth")
|
332 |
recommendations.append("- Consider strategic acquisitions or new market entry")
|
333 |
|
334 |
+
return "Key Recommendations:\n" + "\n".join(recommendations)
|
335 |
|
336 |
def analyze_financials(self, balance_sheet_file, income_stmt_file):
|
337 |
"""Main analysis function"""
|
|
|
391 |
return f"Error in analysis: {str(e)}\n\nDetails: {type(e).__name__}"
|
392 |
|
393 |
def fine_tune_models(self, train_texts, train_labels, epochs=3):
|
394 |
+
"""Fine-tune the model with custom data"""
|
395 |
try:
|
396 |
# Prepare dataset
|
397 |
train_dataset = FinancialDataset(train_texts, train_labels, self.llama_tokenizer)
|
|
|
412 |
|
413 |
# Initialize trainer
|
414 |
trainer = Trainer(
|
415 |
+
model=self.llama_model,
|
416 |
+
args=training_args,
|
417 |
+
train_dataset=train_dataset
|
418 |
)
|
419 |
|
420 |
# Fine-tune the model
|
|
|
429 |
print(f"Error in fine-tuning: {str(e)}")
|
430 |
|
431 |
|
|
|
432 |
def create_interface():
|
433 |
analyzer = FinancialAnalyzer()
|
434 |
|