Update app.py
Browse files
app.py
CHANGED
@@ -21,9 +21,8 @@ pipe = pipeline(
|
|
21 |
device_map="auto",
|
22 |
)
|
23 |
|
24 |
-
|
25 |
def generate_response(financial_goal, risk_tolerance, investment_horizon, monthly_income, monthly_expense, current_savings):
|
26 |
-
# Construct the prompt with the six input fields
|
27 |
prompt = f"""
|
28 |
I need financial advice based on the following information:
|
29 |
|
@@ -37,7 +36,7 @@ def generate_response(financial_goal, risk_tolerance, investment_horizon, monthl
|
|
37 |
Please provide a detailed financial plan.
|
38 |
"""
|
39 |
|
40 |
-
|
41 |
outputs = pipe(
|
42 |
prompt,
|
43 |
max_new_tokens=1000,
|
@@ -45,7 +44,7 @@ def generate_response(financial_goal, risk_tolerance, investment_horizon, monthl
|
|
45 |
response = outputs[0]["generated_text"]
|
46 |
return response
|
47 |
|
48 |
-
|
49 |
iface = gr.Interface(
|
50 |
fn=generate_response,
|
51 |
inputs=[
|
|
|
21 |
device_map="auto",
|
22 |
)
|
23 |
|
24 |
+
|
25 |
def generate_response(financial_goal, risk_tolerance, investment_horizon, monthly_income, monthly_expense, current_savings):
|
|
|
26 |
prompt = f"""
|
27 |
I need financial advice based on the following information:
|
28 |
|
|
|
36 |
Please provide a detailed financial plan.
|
37 |
"""
|
38 |
|
39 |
+
|
40 |
outputs = pipe(
|
41 |
prompt,
|
42 |
max_new_tokens=1000,
|
|
|
44 |
response = outputs[0]["generated_text"]
|
45 |
return response
|
46 |
|
47 |
+
|
48 |
iface = gr.Interface(
|
49 |
fn=generate_response,
|
50 |
inputs=[
|