CCockrum commited on
Commit
ac76927
·
verified ·
1 Parent(s): f8f52b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -113,8 +113,12 @@ def generate_summary(info, ratios):
113
  return summary
114
 
115
  def answer_investing_question(question):
116
- basic_prompt = f"Explain clearly and simply: {question}"
117
- response = summarizer(basic_prompt, max_length=150, min_length=50, do_sample=False)[0]['summary_text']
 
 
 
 
118
  return response
119
 
120
  def calculate_ratios(market_cap, total_revenue, price, dividend_amount, assumed_eps=5.0, growth_rate=0.1, book_value=500000000):
 
113
  return summary
114
 
115
  def answer_investing_question(question):
116
+ prompt = (
117
+ f"Someone asked: '{question}'. "
118
+ f"Please answer clearly but thoroughly and in a conversational tone without restating the question. "
119
+ f"Keep the answer beginner-friendly and encouraging."
120
+ )
121
+ response = summarizer(prompt, max_length=200, min_length=60, do_sample=False)[0]['summary_text']
122
  return response
123
 
124
  def calculate_ratios(market_cap, total_revenue, price, dividend_amount, assumed_eps=5.0, growth_rate=0.1, book_value=500000000):