From 6eeee0787b0edc67ca98d96c6383eefc6451f0d7 Mon Sep 17 00:00:00 2001 From: Bohaska <73286691+Bohaska@users.noreply.github.com> Date: Fri, 3 Mar 2023 22:00:39 +0800 Subject: [PATCH] Fix bug with huggingface headers --- bot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 419fbe4..85e928a 100644 --- a/bot.py +++ b/bot.py @@ -20,12 +20,14 @@ e.g. Who would Donald Trump agree with, 1, 2, 3, or 4?""" for index in range(len(NATIONSTATES_PASSWORDS)): - print(f"Starting up thread {index+1}...") - logging.info(f"Starting up thread {index+1}...") + print(f"Starting up thread {index + 1}...") + logging.info(f"Starting up thread {index + 1}...") ns_ai_thread = threading.Thread(target=ns_ai_bot, args=( - NATION[index], NATIONSTATES_PASSWORDS[index], huggingface_headers, API_URL, prompts[index], USER_AGENT)) + NATION[index], NATIONSTATES_PASSWORDS[index], {"Authorization": f"Bearer {HF_API_TOKEN}"}, API_URL, + prompts[index], USER_AGENT)) ns_ai_thread.start() print(f"Started up thread {index + 1}. Waiting 30 seconds before starting up next thread...") logging.info(f"Started up thread {index + 1}. Waiting 30 seconds before starting up next thread...") time.sleep(30) +