kwanpon commited on
Commit
f1a856e
·
verified ·
1 Parent(s): afa30ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -8,7 +8,9 @@ from transformers import (
8
  TrainingArguments,
9
  Trainer
10
  )
 
11
 
 
12
 
13
  # load dataset
14
  df = pd.read_csv("dataset.csv")
@@ -46,8 +48,8 @@ trainer.train()
46
 
47
  from huggingface_hub import HfApi
48
 
49
- model.push_to_hub("kwanpon/mdeberta-classify-thai")
50
- tokenizer.push_to_hub("kwanpon/mdeberta-classify-thai")
51
 
52
  # inference function for gradio
53
  def classify(text):
 
8
  TrainingArguments,
9
  Trainer
10
  )
11
+ import os
12
 
13
+ token = os.getenv('HF_TOKEN')
14
 
15
  # load dataset
16
  df = pd.read_csv("dataset.csv")
 
48
 
49
  from huggingface_hub import HfApi
50
 
51
+ model.push_to_hub("kwanpon/mdeberta-classify-thai", use_auth_token=token)
52
+ tokenizer.push_to_hub("kwanpon/mdeberta-classify-thai", use_auth_token=token)
53
 
54
  # inference function for gradio
55
  def classify(text):