Skip to content

Commit

Permalink
udpate code for domain selection
Browse files Browse the repository at this point in the history
  • Loading branch information
xingxuanli committed May 30, 2024
1 parent 2be9449 commit 018ad7b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ def s1_reasoning_preparation(dataset, data_point, model, threshold):
print("****************** Start stage 1: reasoning preparation ...")
question = dataset.get_question(data_point)
print("****** Question:", question)

### Domain selection
domain_selection_prompt = domain_selection_demonstration + "Q: " + question.strip() + "\nRelevant domains: "
domain_selection_response = call_openai_api(model, domain_selection_prompt, max_tokens=256, temperature=0)

if domain_selection_response is not None:
domain_selection_text_response = domain_selection_response[1].strip()
print("****** Relevant domains:", domain_selection_text_response)
data_point["s1_domains"] = [x.strip() for x in domain_selection_text_response.split(",")]

### CoT generation
cot_prompt = dataset.get_s1_prompt(question)
Expand Down

0 comments on commit 018ad7b

Please sign in to comment.