Spaces:
Sleeping
Sleeping
final
Browse files
app.py
CHANGED
@@ -342,12 +342,14 @@ ONLY return the JSON.
|
|
342 |
"""
|
343 |
|
344 |
prompt_2 = """Loan transaction details are the information of transaction happened during a period and contains
|
345 |
-
details like Month, EMI as monthly amount paid, Payment status as Paid or Unpaid, outstanding Balance after payment of EMI.
|
|
|
346 |
|
347 |
Return a JSON object
|
348 |
|
349 |
1. COMBININNG monthly transactions for each month
|
350 |
2. WITHOUT missing rows for ANY month
|
|
|
351 |
3. with keys Month, EMI Paid, Payment Status, Interest Amount, Principal Amount, Balance Amount
|
352 |
|
353 |
from text in triple tick marks.
|
@@ -356,8 +358,8 @@ ONLY return the JSON.
|
|
356 |
"""
|
357 |
|
358 |
prompt_template_2 = PromptTemplate.from_template(
|
359 |
-
|
360 |
-
prompt_2 + "```
|
361 |
)
|
362 |
#prompt_template_2.format(response_1 =response_1, loan_data=result.lower())
|
363 |
|
@@ -369,12 +371,12 @@ if st.button('Get Loan Details',type="primary"):
|
|
369 |
progress_text = "Operation in progress. Please wait."
|
370 |
my_bar = st.progress(0, text=progress_text)
|
371 |
|
372 |
-
for percent_complete in range(
|
373 |
time.sleep(0.01)
|
374 |
my_bar.progress(percent_complete + 1, text=progress_text)
|
375 |
time.sleep(1)
|
376 |
|
377 |
-
|
378 |
response_1 = OpenAI().complete(prompt_template_1.format(loan_data=result.lower()))
|
379 |
st.table(create_dataframe_from_text(response_1.text))
|
380 |
my_bar.empty()
|
@@ -387,14 +389,14 @@ if st.button('Get Loan Transactions', type="secondary"):
|
|
387 |
progress_text = "Operation in progress. Please wait."
|
388 |
my_bar = st.progress(0, text=progress_text)
|
389 |
|
390 |
-
for percent_complete in range(
|
391 |
-
time.sleep(0.
|
392 |
my_bar.progress(percent_complete + 1, text=progress_text)
|
393 |
time.sleep(1)
|
394 |
|
395 |
-
|
396 |
-
|
397 |
-
response_2 = OpenAI().complete(prompt_template_2.format(loan_data=result.lower()))
|
398 |
#st.write(response_2)
|
399 |
st.table(create_dataframe_from_text_2(response_2.text))
|
400 |
my_bar.empty()
|
|
|
342 |
"""
|
343 |
|
344 |
prompt_2 = """Loan transaction details are the information of transaction happened during a period and contains
|
345 |
+
details like Month, EMI as monthly amount paid, Payment status as Paid or Unpaid, Interest Amount paid, outstanding Balance after payment of EMI.
|
346 |
+
|
347 |
|
348 |
Return a JSON object
|
349 |
|
350 |
1. COMBININNG monthly transactions for each month
|
351 |
2. WITHOUT missing rows for ANY month
|
352 |
+
3. and get data for all the months
|
353 |
3. with keys Month, EMI Paid, Payment Status, Interest Amount, Principal Amount, Balance Amount
|
354 |
|
355 |
from text in triple tick marks.
|
|
|
358 |
"""
|
359 |
|
360 |
prompt_template_2 = PromptTemplate.from_template(
|
361 |
+
prompt_2 + "```{response_1} {loan_data} ```"
|
362 |
+
#prompt_2 + "```{loan_data} ```"
|
363 |
)
|
364 |
#prompt_template_2.format(response_1 =response_1, loan_data=result.lower())
|
365 |
|
|
|
371 |
progress_text = "Operation in progress. Please wait."
|
372 |
my_bar = st.progress(0, text=progress_text)
|
373 |
|
374 |
+
for percent_complete in range(1000):
|
375 |
time.sleep(0.01)
|
376 |
my_bar.progress(percent_complete + 1, text=progress_text)
|
377 |
time.sleep(1)
|
378 |
|
379 |
+
st.write(result.lower())
|
380 |
response_1 = OpenAI().complete(prompt_template_1.format(loan_data=result.lower()))
|
381 |
st.table(create_dataframe_from_text(response_1.text))
|
382 |
my_bar.empty()
|
|
|
389 |
progress_text = "Operation in progress. Please wait."
|
390 |
my_bar = st.progress(0, text=progress_text)
|
391 |
|
392 |
+
for percent_complete in range(10000):
|
393 |
+
time.sleep(0.1)
|
394 |
my_bar.progress(percent_complete + 1, text=progress_text)
|
395 |
time.sleep(1)
|
396 |
|
397 |
+
st.write(result.lower())
|
398 |
+
response_1 = OpenAI().complete(prompt_template_1.format(loan_data=result.lower()))
|
399 |
+
response_2 = OpenAI().complete(prompt_template_2.format(response_1=response_1.text, loan_data=result.lower()))
|
400 |
#st.write(response_2)
|
401 |
st.table(create_dataframe_from_text_2(response_2.text))
|
402 |
my_bar.empty()
|