Skip to content

Commit b382f6c

Browse files
committed
Update spanish examples so they can run from the root
1 parent 330e6a0 commit b382f6c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

spanish/rag_multiturn.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import csv
22
import os
3+
from pathlib import Path
34

45
import azure.identity
56
import openai
@@ -33,7 +34,9 @@
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)
3942
documents = [{"id": (i + 1), "body": " ".join(row)} for i, row in enumerate(rows[1:])]

spanish/rag_queryrewrite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import csv
22
import os
3+
from pathlib import Path
34

45
import azure.identity
56
import openai
@@ -33,7 +34,8 @@
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)
3941
documents = [{"id": (i + 1), "body": " ".join(row)} for i, row in enumerate(rows[1:])]

0 commit comments

Comments
 (0)