Spaces:
Sleeping
Sleeping
Commit ·
19c9345
1
Parent(s): 95d7c79
Add system
Browse files3 unmodified lines45678911 unmodified lines2122232425262728293031323 unmodified linesfrom tqdm import tqdmimport tiktokenfrom openai import OpenAIdef gpt_4o(input_text):client=OpenAI(api_key=os.environ.get("OAI"))11 unmodified lines)return response.choices[0].message.contentdef run_gpt4_event_extraction(data_dir, icl_path, max_tokens=100000):all_info_path = os.path.join(data_dir, "all_info_with_txt.json")output_dir = os.path.join(data_dir, "gpt4_event_extraction")os.makedirs(output_dir, exist_ok=True)ICL = open(icl_path, "r").read()all_info = open(all_info_path, "r").readlines()3 unmodified lines4567891011 unmodified lines22232425262728293031323334353637383 unmodified linesfrom tqdm import tqdmimport tiktokenfrom openai import OpenAIfrom huggingface_hub import hf_hub_downloaddef gpt_4o(input_text):client=OpenAI(api_key=os.environ.get("OAI"))11 unmodified lines)return response.choices[0].message.contentdef run_gpt4_event_extraction(data_dir, max_tokens=100000):all_info_path = os.path.join(data_dir, "all_info_with_txt.json")output_dir = os.path.join(data_dir, "gpt4_event_extraction")os.makedirs(output_dir, exist_ok=True)icl_path = hf_hub_download(repo_id="PledgeTracker/demo_feedback",filename="icl.txt",repo_type="dataset",token=os.environ["HF_TOKEN"])ICL = open(icl_path, "r").read()all_info = open(all_info_path, "r").readlines()
system/ee.py+8-2