Skip to content

Commit

Permalink
Merge pull request reinteractive#1 from ohbarye/patch-1
Browse files Browse the repository at this point in the history
Fix bug: `questions.rb` always selects the 1st row of CSV
  • Loading branch information
kanehooper authored Mar 3, 2023
2 parents 0586688 + 0eebeeb commit ce13485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions questions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
index_of_max = similarity_array.index(similarity_array.max)
original_text = ""

CSV.foreach("embeddings.csv", headers: true).with_index(index_of_max) do |row, rowno|
CSV.foreach("embeddings.csv", headers: true).with_index do |row, rowno|
if rowno == index_of_max
original_text = row['text']
end
Expand Down Expand Up @@ -59,4 +59,4 @@
)

puts "\nAI response:\n"
puts response['choices'][0]['text'].lstrip
puts response['choices'][0]['text'].lstrip

0 comments on commit ce13485

Please sign in to comment.