Update process_data.py
Browse files- process_data.py +10 -7
process_data.py
CHANGED
|
@@ -194,11 +194,18 @@ def pre_processing(input_data, parameters):
|
|
| 194 |
|
| 195 |
input_text = input_data["input_text"]
|
| 196 |
pre_processing_list = [parameters["context_pre_prompt"], parameters["summary_pre_prompt"], parameters["conversation_pre_prompt"], parameters["example_pre_prompt"]]
|
| 197 |
-
|
|
|
|
|
|
|
| 198 |
for pre_prompt in pre_processing_list:
|
| 199 |
try:
|
| 200 |
-
|
| 201 |
if pre_prompt:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
response = client.chat.completions.create(
|
| 203 |
model=parameters["model_version"],
|
| 204 |
messages=[
|
|
@@ -210,11 +217,7 @@ def pre_processing(input_data, parameters):
|
|
| 210 |
response_text = response.choices[0].message.content
|
| 211 |
partially_processed_input = json.loads(response_text)
|
| 212 |
|
| 213 |
-
|
| 214 |
-
print("Prompt: ")
|
| 215 |
-
print(pre_prompt)
|
| 216 |
-
print("Input Text: ")
|
| 217 |
-
print(input_text)
|
| 218 |
print("Result: ")
|
| 219 |
print(partially_processed_input)
|
| 220 |
|
|
|
|
| 194 |
|
| 195 |
input_text = input_data["input_text"]
|
| 196 |
pre_processing_list = [parameters["context_pre_prompt"], parameters["summary_pre_prompt"], parameters["conversation_pre_prompt"], parameters["example_pre_prompt"]]
|
| 197 |
+
|
| 198 |
+
print("PreProcessingList")
|
| 199 |
+
print(pre_processing_list)
|
| 200 |
for pre_prompt in pre_processing_list:
|
| 201 |
try:
|
| 202 |
+
print("Pre-Processing: ")
|
| 203 |
if pre_prompt:
|
| 204 |
+
print("Prompt: ")
|
| 205 |
+
print(pre_prompt)
|
| 206 |
+
print("Input Text: ")
|
| 207 |
+
print(input_text)
|
| 208 |
+
|
| 209 |
response = client.chat.completions.create(
|
| 210 |
model=parameters["model_version"],
|
| 211 |
messages=[
|
|
|
|
| 217 |
response_text = response.choices[0].message.content
|
| 218 |
partially_processed_input = json.loads(response_text)
|
| 219 |
|
| 220 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
print("Result: ")
|
| 222 |
print(partially_processed_input)
|
| 223 |
|