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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -10,6 +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
 
14
  def process(model_id, dataset):
15
  # Step 1: Load dataset
@@ -47,7 +48,8 @@ def process(model_id, dataset):
47
 
48
  #Step 5: Fine-tune the model
49
 
50
- huggingface_hub.login(os.environ["OPENAI_API_KEY"])
 
51
 
52
  model_id = model_id
53
  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 HfApi
14
 
15
  def process(model_id, dataset):
16
  # Step 1: Load 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)