Spaces:
Runtime error
Runtime error
xuyingliKepler
commited on
Commit
•
a77165b
1
Parent(s):
9d5ac82
Update app.py
Browse files
app.py
CHANGED
@@ -81,7 +81,7 @@ def get_image_as_base64_string(path):
|
|
81 |
with open(path, "rb") as image_file:
|
82 |
return base64.b64encode(image_file.read()).decode()
|
83 |
|
84 |
-
def
|
85 |
response = qa_chain({"question": question})
|
86 |
return response["answer"]
|
87 |
|
@@ -117,7 +117,7 @@ def setup_agents(config_list, answer_function):
|
|
117 |
llm_config=llm_config,
|
118 |
system_message="""Reply TERMINATE if the task has been solved at full satisfaction.
|
119 |
Otherwise, reply CONTINUE, or the reason why the task is not solved yet.""",
|
120 |
-
function_map={"
|
121 |
)
|
122 |
return assistant, user_proxy
|
123 |
|
|
|
81 |
with open(path, "rb") as image_file:
|
82 |
return base64.b64encode(image_file.read()).decode()
|
83 |
|
84 |
+
def answer_question(question, qa_chain):
|
85 |
response = qa_chain({"question": question})
|
86 |
return response["answer"]
|
87 |
|
|
|
117 |
llm_config=llm_config,
|
118 |
system_message="""Reply TERMINATE if the task has been solved at full satisfaction.
|
119 |
Otherwise, reply CONTINUE, or the reason why the task is not solved yet.""",
|
120 |
+
function_map={"answer_function": answer_function}
|
121 |
)
|
122 |
return assistant, user_proxy
|
123 |
|