bstraehle commited on
Commit
ffbcd18
1 Parent(s): 31db709

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
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 HfApi
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
- api = HfApi()
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)