tensorgirl commited on
Commit
c4ee0af
·
verified ·
1 Parent(s): 71df0ea

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +8 -1
utils.py CHANGED
@@ -92,7 +92,14 @@ def summary(input_json):
92
 
93
  output["Stock Ticker"] = input_json['symbol']
94
 
95
- answer = "You are an financial expert " + callAzure(promptShort[id] + " Do not exceed over 500 characters", long_text)
 
 
 
 
 
 
 
96
  try:
97
  idx = answer.index("\n")
98
  except:
 
92
 
93
  output["Stock Ticker"] = input_json['symbol']
94
 
95
+ answer = callAzure("You are an financial expert " + promptShort[id] + " Do not exceed over 500 characters", long_text)
96
+ try:
97
+ idx = answer.index("\n")
98
+ except:
99
+ idx = -2
100
+ output['Short Summary'] = answer[idx+2:]
101
+
102
+ answer = callAzure("Make sure the following summary of a news article is not more than 100 words. Rewrite it and make it below 100 words ", output['ShortSummary'])
103
  try:
104
  idx = answer.index("\n")
105
  except: