Spaces:
Sleeping
Sleeping
diana3135
commited on
Commit
·
35425cb
1
Parent(s):
77e60e8
update prompts in merge_texts_sequential
Browse files
utils.py
CHANGED
|
@@ -50,27 +50,27 @@ def generate_text_with_gpt(prompts, api_key = None):
|
|
| 50 |
|
| 51 |
|
| 52 |
def generate_ai_initial_answer(task_descriotion, api_key=None):
|
| 53 |
-
prompt = f"Given the task
|
| 54 |
return generate_text_with_gpt(prompt, api_key)
|
| 55 |
|
| 56 |
def merge_texts_parallel(task_description, human_text, ai_text, api_key = None):
|
| 57 |
-
prompt = f"Given the task
|
| 58 |
f"The first answer: {human_text}\nThe second answer: {ai_text}\n" + \
|
| 59 |
f"Merge the two answers into one in a coherent way: "
|
| 60 |
return generate_text_with_gpt(prompt, api_key)
|
| 61 |
|
| 62 |
def merge_texts_sequential(task_description, human_text, api_key = None):
|
| 63 |
-
prompt = f"Given the task
|
| 64 |
-
f"
|
| 65 |
return generate_text_with_gpt(prompt, api_key)
|
| 66 |
|
| 67 |
def modify_with_suggestion(task_description, text, suggestions, api_key = None):
|
| 68 |
-
prompt = f"Given the task
|
| 69 |
f"Modify the answer based on the following suggestions: {suggestions}"
|
| 70 |
return generate_text_with_gpt(prompt, api_key)
|
| 71 |
|
| 72 |
def get_evaluation_with_gpt(task_description, text, api_key = None):
|
| 73 |
-
prompt = f"Given the task
|
| 74 |
f"Evaluate the answer and provide scores between 0 and 10,\n" + \
|
| 75 |
f"where criteria for evaluation are Novelty, Feasibility, and Defensibility.\n" + \
|
| 76 |
f"Use a professional standard, where 5 represents an acceptable quality,\n" + \
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
def generate_ai_initial_answer(task_descriotion, api_key=None):
|
| 53 |
+
prompt = f"Given the task: {task_descriotion}, provide an answer: "
|
| 54 |
return generate_text_with_gpt(prompt, api_key)
|
| 55 |
|
| 56 |
def merge_texts_parallel(task_description, human_text, ai_text, api_key = None):
|
| 57 |
+
prompt = f"Given the task: {task_description}, there are two answers provided:\n" + \
|
| 58 |
f"The first answer: {human_text}\nThe second answer: {ai_text}\n" + \
|
| 59 |
f"Merge the two answers into one in a coherent way: "
|
| 60 |
return generate_text_with_gpt(prompt, api_key)
|
| 61 |
|
| 62 |
def merge_texts_sequential(task_description, human_text, api_key = None):
|
| 63 |
+
prompt = f"Given the task:{task_description}, here is the answer provided by the human: {human_text}\n" + \
|
| 64 |
+
f"Refine this response and ensure the final answer aligns with the human's intent:"
|
| 65 |
return generate_text_with_gpt(prompt, api_key)
|
| 66 |
|
| 67 |
def modify_with_suggestion(task_description, text, suggestions, api_key = None):
|
| 68 |
+
prompt = f"Given the task:{task_description}, the answer provided is: {text}\n" + \
|
| 69 |
f"Modify the answer based on the following suggestions: {suggestions}"
|
| 70 |
return generate_text_with_gpt(prompt, api_key)
|
| 71 |
|
| 72 |
def get_evaluation_with_gpt(task_description, text, api_key = None):
|
| 73 |
+
prompt = f"Given the task:{task_description}, the answer provided is: {text}\n" + \
|
| 74 |
f"Evaluate the answer and provide scores between 0 and 10,\n" + \
|
| 75 |
f"where criteria for evaluation are Novelty, Feasibility, and Defensibility.\n" + \
|
| 76 |
f"Use a professional standard, where 5 represents an acceptable quality,\n" + \
|