mirror of
https://github.com/collinsctk/chatgpt_embeddings.git
synced 2025-07-19 00:00:05 +08:00
最终注释
This commit is contained in:
parent
73472dfd71
commit
cbb091efa4
@ -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
Loading…
x
Reference in New Issue
Block a user