File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
projects/ml/llm/notebooks Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 22 (:require
33 [org.httpkit.client :as hk-client]
44 [cheshire.core :as json]))
5-
5+
66; ;# using Large Language Models from Clojure
77; ;LLMs often come as APIs, as they require computing power (GPUs), which most users do not have
88; ;localy.
Original file line number Diff line number Diff line change 4848; ; ## Key Features
4949; ; Configurable Chunking: Allows adjustment of chunk size and overlap.
5050; ;
51- ; ; Efficient Retrieval: Uses FAISS for fast similarity search.
51+ ; ; Simple Retrieval: Uses InMemoryVectorStore for JVM based similarity search.
5252; ;
5353; ; Usage Example
5454; ; The code includes a test query: "What is the main cause of climate change?".
7474(defn replace-t-with-space [list-of-documents]
7575 (map
7676 (fn [text-segment]
77- (let [cleaned-text (-> text-segment .text (str/replace #"/ t" " " ))
77+ (let [cleaned-text (-> text-segment .text (str/replace #"\ t " " " ))
7878 meta (-> text-segment .metadata)]
7979 (TextSegment/from cleaned-text meta)))
8080 list-of-documents))
You can’t perform that action at this time.
0 commit comments