Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,9 +90,11 @@ def generate_response(manual, proposal):
|
|
| 90 |
return response.choices[0].message.content
|
| 91 |
|
| 92 |
def loop_function(df):
|
| 93 |
-
text = "==============================================================="
|
| 94 |
Value_of_proposal = ""
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
for index, row in df.iterrows():
|
| 97 |
key = str(row['Field'])
|
| 98 |
value = str(row['Value'])
|
|
@@ -100,9 +102,21 @@ def loop_function(df):
|
|
| 100 |
proposal_details = ""
|
| 101 |
manual_rules = ""
|
| 102 |
|
| 103 |
-
if key == "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
continue
|
| 105 |
-
|
| 106 |
if key == "Value (Rs)":
|
| 107 |
Value_of_proposal = f"The proposal Value is {value}. \n"
|
| 108 |
continue
|
|
@@ -130,7 +144,7 @@ def loop_function(df):
|
|
| 130 |
try:
|
| 131 |
rr = generate_response(manual_rules, proposal_details)
|
| 132 |
text += rr + "\n\n" # FIXED: accumulate
|
| 133 |
-
text +="==============================================================="
|
| 134 |
yield text
|
| 135 |
time.sleep(3)
|
| 136 |
except Exception as e:
|
|
|
|
| 90 |
return response.choices[0].message.content
|
| 91 |
|
| 92 |
def loop_function(df):
|
| 93 |
+
text = "===============================================================\n"
|
| 94 |
Value_of_proposal = ""
|
| 95 |
+
E_file_No=""
|
| 96 |
+
Name_of_proposal=""
|
| 97 |
+
PR_no=""
|
| 98 |
for index, row in df.iterrows():
|
| 99 |
key = str(row['Field'])
|
| 100 |
value = str(row['Value'])
|
|
|
|
| 102 |
proposal_details = ""
|
| 103 |
manual_rules = ""
|
| 104 |
|
| 105 |
+
if key == "Justification/Reason for Procurement":
|
| 106 |
+
continue
|
| 107 |
+
if key == "File No.":
|
| 108 |
+
E_file_No= f"E-File No: {value}. \n"
|
| 109 |
+
text+=E_file_No
|
| 110 |
+
continue
|
| 111 |
+
if key == "PR No.":
|
| 112 |
+
PR_no= f"PR No: {value}. \n"
|
| 113 |
+
text+=PR_no
|
| 114 |
+
continue
|
| 115 |
+
if key == "Name of proposal":
|
| 116 |
+
Name_of_proposal= f"Name of the proposal : {value}. \n"
|
| 117 |
+
text+=Name_of_proposal
|
| 118 |
+
text+="===============================================================\n"
|
| 119 |
continue
|
|
|
|
| 120 |
if key == "Value (Rs)":
|
| 121 |
Value_of_proposal = f"The proposal Value is {value}. \n"
|
| 122 |
continue
|
|
|
|
| 144 |
try:
|
| 145 |
rr = generate_response(manual_rules, proposal_details)
|
| 146 |
text += rr + "\n\n" # FIXED: accumulate
|
| 147 |
+
text +="===============================================================\n"
|
| 148 |
yield text
|
| 149 |
time.sleep(3)
|
| 150 |
except Exception as e:
|