Skip to content

Commit f369ef5

Browse files
authored
Rename ConTextTab -> sap-rpt-1-oss (#1832)
The [model and repo](https://huggingface.co/SAP/sap-rpt-1-oss) have been renamed. This PR adjusts the tag and snippets accordingly.
1 parent 54c7655 commit f369ef5

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,22 @@ pred_df = pipeline.predict_df(
156156
return [installSnippet, exampleSnippet];
157157
};
158158

159-
export const contexttab = (): string[] => {
160-
const installSnippet = `pip install git+https://github.com/SAP-samples/contexttab`;
159+
export const sap_rpt_one_oss = (): string[] => {
160+
const installSnippet = `pip install git+https://github.com/SAP-samples/sap-rpt-1-oss`;
161161

162162
const classificationSnippet = `# Run a classification task
163163
from sklearn.datasets import load_breast_cancer
164164
from sklearn.metrics import accuracy_score
165165
from sklearn.model_selection import train_test_split
166166
167-
from contexttab import ConTextTabClassifier
167+
from sap_rpt_oss import SAP_RPT_OSS_Classifier
168168
169169
# Load sample data
170170
X, y = load_breast_cancer(return_X_y=True)
171171
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
172172
173-
# Initialize a classifier
174-
# You can omit checkpoint and checkpoint_revision to use the default model
175-
clf = ConTextTabClassifier(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
173+
# Initialize a classifier, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
174+
clf = SAP_RPT_OSS_Classifier(max_context_size=8192, bagging=8)
176175
177176
clf.fit(X_train, y_train)
178177
@@ -187,8 +186,7 @@ from sklearn.datasets import fetch_openml
187186
from sklearn.metrics import r2_score
188187
from sklearn.model_selection import train_test_split
189188
190-
from contexttab import ConTextTabRegressor
191-
189+
from sap_rpt_oss import SAP_RPT_OSS_Regressor
192190
193191
# Load sample data
194192
df = fetch_openml(data_id=531, as_frame=True)
@@ -198,9 +196,8 @@ y = df.target.astype(float)
198196
# Train-test split
199197
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=42)
200198
201-
# Initialize the regressor
202-
# You can omit checkpoint and checkpoint_revision to use the default model
203-
regressor = ConTextTabRegressor(checkpoint="l2/base.pt", checkpoint_revision="v1.0.0", bagging=1, max_context_size=2048)
199+
# Initialize the regressor, 8k context and 8-fold bagging gives best performance, reduce if running out of memory
200+
regressor = SAP_RPT_OSS_Regressor(max_context_size=8192, bagging=8)
204201
205202
regressor.fit(X_train, y_train)
206203

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,6 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
235235
repoUrl: "https://github.com/Unbabel/COMET/",
236236
countDownloads: `path:"hparams.yaml"`,
237237
},
238-
contexttab: {
239-
prettyLabel: "ConTextTab",
240-
repoName: "ConTextTab",
241-
repoUrl: "https://github.com/SAP-samples/contexttab",
242-
countDownloads: `path_extension:"pt"`,
243-
snippets: snippets.contexttab,
244-
},
245238
cosmos: {
246239
prettyLabel: "Cosmos",
247240
repoName: "Cosmos",
@@ -966,6 +959,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
966959
filter: true,
967960
countDownloads: `path:"cfg.json"`,
968961
},
962+
"sap-rpt-1-oss": {
963+
prettyLabel: "sap-rpt-1-oss",
964+
repoName: "sap-rpt-1-oss",
965+
repoUrl: "https://github.com/SAP-samples/sap-rpt-1-oss",
966+
countDownloads: `path_extension:"pt"`,
967+
snippets: snippets.sap_rpt_one_oss,
968+
},
969969
sapiens: {
970970
prettyLabel: "sapiens",
971971
repoName: "sapiens",

0 commit comments

Comments
 (0)