@@ -132,10 +132,10 @@ wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH)
132132ta.save("test-2.wav", wav, model.sr)` ,
133133] ;
134134
135- export const contexttab = ( ) : string [ ] => [
136- `# pip install git+https://github.com/SAP-samples/contexttab
135+ export const contexttab = ( ) : string [ ] => {
136+ const installSnippet = ` pip install git+https://github.com/SAP-samples/contexttab` ;
137137
138- # Run a classification task
138+ const classificationSnippet = ` # Run a classification task
139139from sklearn.datasets import load_breast_cancer
140140from sklearn.metrics import accuracy_score
141141from sklearn.model_selection import train_test_split
@@ -155,9 +155,9 @@ clf.fit(X_train, y_train)
155155prediction_probabilities = clf.predict_proba(X_test)
156156# Predict labels
157157predictions = clf.predict(X_test)
158- print("Accuracy", accuracy_score(y_test, predictions))
158+ print("Accuracy", accuracy_score(y_test, predictions))` ;
159159
160- # Run a regression task
160+ const regressionsSnippet = ` # Run a regression task
161161from sklearn.datasets import fetch_openml
162162from sklearn.metrics import r2_score
163163from sklearn.model_selection import train_test_split
@@ -182,8 +182,9 @@ regressor.fit(X_train, y_train)
182182predictions = regressor.predict(X_test)
183183
184184r2 = r2_score(y_test, predictions)
185- print("R² Score:", r2)` ,
186- ] ;
185+ print("R² Score:", r2)` ;
186+ return [ installSnippet , classificationSnippet , regressionsSnippet ] ;
187+ } ;
187188
188189
189190export const cxr_foundation = ( ) : string [ ] => [
0 commit comments