Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import os
|
|
10 |
from datasets import Dataset, DatasetDict, load_dataset
|
11 |
from peft import LoraConfig, PeftModel, prepare_model_for_kbit_training, get_peft_model
|
12 |
from transformers import (AutoTokenizer, BitsAndBytesConfig, TrainingArguments, AutoModelForSequenceClassification, Trainer, EarlyStoppingCallback, DataCollatorWithPadding)
|
13 |
-
from huggingface_hub import
|
14 |
|
15 |
def process(model_id, dataset):
|
16 |
# Step 1: Load dataset
|
@@ -48,8 +48,7 @@ def process(model_id, dataset):
|
|
48 |
|
49 |
#Step 5: Fine-tune the model
|
50 |
|
51 |
-
|
52 |
-
api.login(token=os.environ["HF_TOKEN"])
|
53 |
|
54 |
model_id = model_id
|
55 |
model = AutoModelForSequenceClassification.from_pretrained(model_id)
|
|
|
10 |
from datasets import Dataset, DatasetDict, load_dataset
|
11 |
from peft import LoraConfig, PeftModel, prepare_model_for_kbit_training, get_peft_model
|
12 |
from transformers import (AutoTokenizer, BitsAndBytesConfig, TrainingArguments, AutoModelForSequenceClassification, Trainer, EarlyStoppingCallback, DataCollatorWithPadding)
|
13 |
+
from huggingface_hub import login
|
14 |
|
15 |
def process(model_id, dataset):
|
16 |
# Step 1: Load dataset
|
|
|
48 |
|
49 |
#Step 5: Fine-tune the model
|
50 |
|
51 |
+
login(token=os.environ.get("HF_TOKEN"))
|
|
|
52 |
|
53 |
model_id = model_id
|
54 |
model = AutoModelForSequenceClassification.from_pretrained(model_id)
|