File tree Expand file tree Collapse file tree 4 files changed +37
-12
lines changed
semantic-search-with-openai-embedding-creation
semantic-search-with-openai-qa Expand file tree Collapse file tree 4 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ documentation = "https://docs.singlestore.com"
1010
1111[samples ]
1212display = [
13- " Getting Started with Notebooks " ,
14- " Notebook Basics " ,
15- " Image Matching with SQL " ,
16- " Movie Recommendation " ,
17- " Semantic Search with OpenAI QA " ,
18- " Semantic Search with OpenAI Embedding Creation " ,
19- " Atlas & Kai for Mongo Side-by-Side " ,
13+ " getting-started- with-notebooks " ,
14+ " notebook-basics " ,
15+ " image-matching- with-sql " ,
16+ " movie-recommendation " ,
17+ " semantic-search- with-openai-qa " ,
18+ " semantic-search- with-openai-embedding-creation " ,
19+ " atlas-and-kai-for-mongo " ,
2020]
Original file line number Diff line number Diff line change 11[meta ]
2+ title =" Semantic Search with OpenAI Embedding Creation"
23description =" "
3- tags =[]
4+ tags =[" openai " ]
Original file line number Diff line number Diff line change 11[meta ]
22title =" Semantic Search with OpenAI QA"
33description =" "
4- tags =[]
4+ tags =[" openai " ]
Original file line number Diff line number Diff line change 3535 meta = tomllib .load (f )
3636 files = []
3737 for i , name in enumerate (meta ['samples' ]['display' ]):
38+
39+ # Verify the notebook file exists
3840 path = os .path .join (
3941 args .notebooks_directory ,
40- name , name + ' .ipynb' ,
42+ name , 'notebook .ipynb' ,
4143 )
4244 if not os .path .isfile (path ):
4345 print (
44- f'error: `.ipynb` file does not exist at { path } ' ,
46+ f'error: notebook file does not exist at { path } ' ,
4547 file = sys .stderr ,
4648 )
4749 sys .exit (1 )
48- files .append ((path , f'{ i + 1 :02} - { os .path .basename (path )} .json' ))
50+
51+ # Verify the metadata file exists
52+ meta_path = os .path .join (
53+ args .notebooks_directory ,
54+ name , 'meta.toml' ,
55+ )
56+ if not os .path .isfile (meta_path ):
57+ print (
58+ f'error: metadata file does not exist at { meta_path } ' ,
59+ file = sys .stderr ,
60+ )
61+ sys .exit (1 )
62+
63+ with open (meta_path , 'rb' ) as meta_toml :
64+ nb_meta = tomllib .load (meta_toml )
65+
66+ try :
67+ files .append (
68+ (path , f'{ i + 1 :02} - { nb_meta ["meta" ]["title" ]} .json' ),
69+ )
70+ except Exception :
71+ print (path , ' =>\n ' , nb_meta )
72+ raise
4973
5074 with ZipFile (args .outfile , 'w' ) as out :
5175 for path , name in files :
You can’t perform that action at this time.
0 commit comments