This commit is contained in:
ahmed531998 2023-07-31 12:17:35 +02:00
parent c58e667254
commit af0bd24538
1 changed files with 4 additions and 4 deletions

View File

@ -180,8 +180,8 @@ def predict():
def feedback():
data = request.get_json().get("feedback")
print(data)
try:
"""
conn = psycopg2.connect(host="janet-pg", database=os.getenv("POSTGRES_DB"), user=os.getenv("POSTGRES_USER"), password=os.getenv("POSTGRES_PASSWORD"))
cur = conn.cursor()
cur.execute('INSERT INTO feedback_experimental (query, history, janet_modified_query, is_modified_query_correct, user_modified_query, evidence_useful, response, preferred_response, response_length_feedback, response_fluency_feedback, response_truth_feedback, response_useful_feedback, response_time_feedback, response_intent) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)',
@ -191,7 +191,7 @@ def feedback():
data['speed'], data['intent']))
conn.commit()
cur.close()
"""
reply = jsonify({"status": "done"})
return reply
@ -242,7 +242,7 @@ if __name__ == "__main__":
del coref_resolver
threading.Thread(target=vre_fetch, name='updatevre').start()
threading.Thread(target=clear_inactive, name='clear').start()
"""
conn = psycopg2.connect(host="janet-pg", database=os.getenv("POSTGRES_DB"), user=os.getenv("POSTGRES_USER"), password=os.getenv("POSTGRES_PASSWORD"))
cur = conn.cursor()
@ -264,5 +264,5 @@ if __name__ == "__main__":
)
conn.commit()
cur.close()
"""
app.run(host='0.0.0.0')