Spaces:
Running
Running
Update custom_utils.py
Browse files- custom_utils.py +2 -1
custom_utils.py
CHANGED
@@ -126,11 +126,12 @@ def rag_retrieval_advanced(openai_api_key,
|
|
126 |
return retrieval_result
|
127 |
|
128 |
def inference(openai_api_key, prompt):
|
129 |
-
content = f"Answer
|
130 |
return invoke_llm(openai_api_key, content)
|
131 |
|
132 |
def rag_inference(openai_api_key, prompt, retrieval_result):
|
133 |
content = f"Answer this user question: {prompt} with the following context:\n{retrieval_result}"
|
|
|
134 |
return invoke_llm(openai_api_key, content)
|
135 |
|
136 |
def invoke_llm(openai_api_key, content):
|
|
|
126 |
return retrieval_result
|
127 |
|
128 |
def inference(openai_api_key, prompt):
|
129 |
+
content = f"Answer the question. If you don't know the answer, just say that you don't know, don't try to make up an answer. Keep the answer as concise as possible.\n\nQuestion: {prompt}\nHelpful Answer: "
|
130 |
return invoke_llm(openai_api_key, content)
|
131 |
|
132 |
def rag_inference(openai_api_key, prompt, retrieval_result):
|
133 |
content = f"Answer this user question: {prompt} with the following context:\n{retrieval_result}"
|
134 |
+
content = f"Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Keep the answer as concise as possible.\n\n{retrieval_result}\n\nQuestion: {prompt}\nHelpful Answer: "
|
135 |
return invoke_llm(openai_api_key, content)
|
136 |
|
137 |
def invoke_llm(openai_api_key, content):
|