Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,8 +24,8 @@ model = AutoModelForSequenceClassification.from_pretrained(model_name, num_label
|
|
24 |
|
25 |
# Define a tokenization function
|
26 |
def preprocess_function(examples):
|
27 |
-
#
|
28 |
-
inputs =
|
29 |
return tokenizer(inputs, padding="max_length", truncation=True, max_length=32)
|
30 |
|
31 |
# Apply the tokenization function to the datasets
|
@@ -53,3 +53,4 @@ trainer = Trainer(
|
|
53 |
# Train and evaluate the model
|
54 |
trainer.train()
|
55 |
trainer.evaluate()
|
|
|
|
24 |
|
25 |
# Define a tokenization function
|
26 |
def preprocess_function(examples):
|
27 |
+
# Convert each feature to a string and concatenate them
|
28 |
+
inputs = [f"{age} {bmi} {hba1c}" for age, bmi, hba1c in zip(examples["age"], examples["bmi"], examples["HbA1c_level"])]
|
29 |
return tokenizer(inputs, padding="max_length", truncation=True, max_length=32)
|
30 |
|
31 |
# Apply the tokenization function to the datasets
|
|
|
53 |
# Train and evaluate the model
|
54 |
trainer.train()
|
55 |
trainer.evaluate()
|
56 |
+
|