File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import csv
22import os
3+ from pathlib import Path
34
45import azure .identity
56import openai
3334 MODEL_NAME = os .environ ["OPENAI_MODEL" ]
3435
3536# Indexamos los datos del CSV
36- with open ("hybridos.csv" ) as file :
37+
38+ CSV_PATH = Path (__file__ ).with_name ("hybridos.csv" )
39+ with CSV_PATH .open (newline = "" , encoding = "utf-8" ) as file :
3740 reader = csv .reader (file )
3841 rows = list (reader )
3942documents = [{"id" : (i + 1 ), "body" : " " .join (row )} for i , row in enumerate (rows [1 :])]
Original file line number Diff line number Diff line change 11import csv
22import os
3+ from pathlib import Path
34
45import azure .identity
56import openai
3334 MODEL_NAME = os .environ ["OPENAI_MODEL" ]
3435
3536# Indexar los datos del CSV
36- with open ("hybridos.csv" ) as file :
37+ CSV_PATH = Path (__file__ ).with_name ("hybridos.csv" )
38+ with CSV_PATH .open (newline = "" , encoding = "utf-8" ) as file :
3739 reader = csv .reader (file )
3840 rows = list (reader )
3941documents = [{"id" : (i + 1 ), "body" : " " .join (row )} for i , row in enumerate (rows [1 :])]
You can’t perform that action at this time.
0 commit comments