最终注释

This commit is contained in:
administrator 2023-03-31 22:42:32 +08:00
parent 73472dfd71
commit cbb091efa4
2 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ def compute_doc_embeddings(df: pd.DataFrame):
return df return df
def get_embeddings(openai_api_key, excel_file_path, csv_file_path): def get_embeddings(excel_file_path, csv_file_path):
df = pd.read_excel(excel_file_path) df = pd.read_excel(excel_file_path)
# 删除换行"\n" # 删除换行"\n"
df['prompt'] = df['prompt'].apply(lambda x: x.replace('\n', '')) df['prompt'] = df['prompt'].apply(lambda x: x.replace('\n', ''))
@ -73,4 +73,4 @@ def get_embeddings(openai_api_key, excel_file_path, csv_file_path):
if __name__ == '__main__': if __name__ == '__main__':
get_embeddings(api_key, excel_file_path, csv_file_path) get_embeddings(excel_file_path, csv_file_path)

File diff suppressed because one or more lines are too long