davda54 commited on
Commit
f3c7c3a
·
verified ·
1 Parent(s): 7a48571

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -10,6 +10,7 @@ import hashlib
10
  import itertools
11
  from datasets import load_dataset, Dataset, DatasetDict
12
  from huggingface_hub import HfApi, create_repo, repo_exists, Repository
 
13
  import shutil
14
  import threading
15
 
@@ -18,6 +19,10 @@ from collections.abc import Iterable
18
  from gradio.themes.base import Base
19
  from gradio.themes.utils import colors, fonts, sizes
20
 
 
 
 
 
21
 
22
  class Soft(Base):
23
  def __init__(
@@ -224,8 +229,6 @@ DATA_DIR = "annotation_data"
224
  ANNOTATIONS_FILE = os.path.join(DATA_DIR, "train.jsonl")
225
  os.makedirs(DATA_DIR, exist_ok=True)
226
 
227
- HF_TOKEN = os.environ.get("HF_TOKEN")
228
-
229
  # Model names for the three responses
230
  MODEL_NAMES = ["mistral-Nemo", "translated-SFT", "on-policy-RL"]
231
 
 
10
  import itertools
11
  from datasets import load_dataset, Dataset, DatasetDict
12
  from huggingface_hub import HfApi, create_repo, repo_exists, Repository
13
+ from huggingface_hub import HfFolder
14
  import shutil
15
  import threading
16
 
 
19
  from gradio.themes.base import Base
20
  from gradio.themes.utils import colors, fonts, sizes
21
 
22
+ HF_TOKEN = os.environ.get("HF_TOKEN")
23
+ os.environ['HF_AUTH'] = HF_TOKEN
24
+ HfApi(token=HF_TOKEN)
25
+
26
 
27
  class Soft(Base):
28
  def __init__(
 
229
  ANNOTATIONS_FILE = os.path.join(DATA_DIR, "train.jsonl")
230
  os.makedirs(DATA_DIR, exist_ok=True)
231
 
 
 
232
  # Model names for the three responses
233
  MODEL_NAMES = ["mistral-Nemo", "translated-SFT", "on-policy-RL"]
234