Skip to content

Commit

Permalink
Fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
markbotterill committed May 24, 2024
1 parent d09cc20 commit a7ba90a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/scripts/hubgpt_eval_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import requests
from slack_sdk import WebClient

CSV_PATH = "/app/scripts/hubgpt_eval.csv"

def create_new_chat_session(danswer_url: str, api_key: str | None) -> int:
headers = {"Authorization": f"Bearer {api_key}"} if api_key else None
Expand Down Expand Up @@ -74,15 +75,15 @@ def upload_to_slack(filename, channel_id):

if __name__ == "__main__":

data = pd.read_csv("hubgpt_eval.csv")
data = pd.read_csv(CSV_PATH)

queries_list = data.Query.tolist()

responses = []

for num, query in enumerate(queries_list):
print(f"Query {num+1}/{len(queries_list)}: {query}")
# response = process_question(danswer_url="https://hubgpt-staging.idinsight.io",
# response = process_question(danswer_url="https:/CSV_PATHdinsight.io",
# question=query,
# api_key=None)
response = 1
Expand All @@ -94,7 +95,7 @@ def upload_to_slack(filename, channel_id):
data[today_str] = responses

# Record + send info
data.to_csv("hubgpt_eval.csv", index = False)
data.to_csv(CSV_PATH, index = False)
print("Complete")
CHANNEL_ID = os.environ.get("METRICS_CHANNEL_ID")
upload_to_slack("hubgpt_eval.csv", CHANNEL_ID)
upload_to_slack(CSV_PATH, CHANNEL_ID)

0 comments on commit a7ba90a

Please sign in to comment.