Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def generate_advice(name, age, income, expenses, savings, debts, investment_preferences, risk_tolerance, retirement_age, retirement_savings_goal, short_term_goals, long_term_goals, dependents, health_expenses, education_expenses, insurance_policies, major_purchases, emergency_fund, annual_income_growth, annual_expense_growth, currency):
|
4 |
prompt = (
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
def financial_planning(prompt):
|
5 |
+
messages = [
|
6 |
+
{"role": "system", "content": "You are a financial advisor who guides users on their investment plan!"},
|
7 |
+
{"role": "user", "content": {prompt}}]
|
8 |
+
chatbot = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.3")
|
9 |
+
return chatbot(messages)
|
10 |
+
|
11 |
|
12 |
def generate_advice(name, age, income, expenses, savings, debts, investment_preferences, risk_tolerance, retirement_age, retirement_savings_goal, short_term_goals, long_term_goals, dependents, health_expenses, education_expenses, insurance_policies, major_purchases, emergency_fund, annual_income_growth, annual_expense_growth, currency):
|
13 |
prompt = (
|