-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# %% | ||
from pathlib import Path | ||
|
||
API_DOC = Path( | ||
"/Users/glemaitre/Documents/packages/scikit-learn/doc/_build/html/stable/" | ||
"modules/generated" | ||
) | ||
|
||
# %% | ||
# temporary add the path to the sys.path | ||
import sys | ||
sys.path.append("/Users/glemaitre/Documents/scratch/rag_based_llm") | ||
from sphinx_rag_search_engine.scraping import extract_api_doc | ||
|
||
input_texts = extract_api_doc(API_DOC, n_jobs=-1) | ||
text = [text["text"] for text in input_texts] | ||
|
||
# %% | ||
from sentence_transformers import SentenceTransformer | ||
|
||
model = SentenceTransformer("thenlper/gte-large") | ||
model.encode(text, show_progress_bar=True) | ||
|
||
# %% |