Skip to content

Commit

Permalink
get llm response
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzin3 committed Oct 22, 2024
1 parent 3f15278 commit 72e699c
Show file tree
Hide file tree
Showing 5 changed files with 15,882 additions and 2 deletions.
29 changes: 29 additions & 0 deletions prepare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from pathlib import Path

text = Path("four_truths.txt").read_text(encoding="utf-8")

data = []

for line in text.splitlines():
data.append(line)

data = [line for line in data if line]

json_data = []
char_count = 0
for idx, line in enumerate(data):
curr_json_data = {}
span = {"start": char_count, "end": len(line) + char_count}
char_count += len(line)
curr_json_data = {
"span": span,
"content": line,
"pecha": "four_truth",
"line_count": idx,
}
json_data.append(curr_json_data)


from bo_rag_prep_tool.utils import write_json

write_json("four_truth.json", json_data)
Loading

0 comments on commit 72e699c

Please sign in to comment.