cahya commited on
Commit
96e52af
·
1 Parent(s): b77fd74

use auth token

Browse files
Files changed (1) hide show
  1. app/app.py +3 -1
app/app.py CHANGED
@@ -16,6 +16,8 @@ mirror_url = "https://news-generator.ai-research.id/"
16
  if "MIRROR_URL" in os.environ:
17
  mirror_url = os.environ["MIRROR_URL"]
18
  hf_auth_token = os.getenv("HF_AUTH_TOKEN", False)
 
 
19
 
20
  MODELS = {
21
  "Indonesian Newspaper - Indonesian GPT-2 Medium": {
@@ -110,7 +112,7 @@ def process(text_generator, tokenizer, title: str, keywords: str, text: str,
110
  temperature=temperature,
111
  repetition_penalty=repetition_penalty,
112
  num_return_sequences=1,
113
- hf_auth_token=hf_auth_token
114
  )
115
  result = tokenizer.decode(sample_outputs[0], skip_special_tokens=True)
116
  print(f"result: {result}")
 
16
  if "MIRROR_URL" in os.environ:
17
  mirror_url = os.environ["MIRROR_URL"]
18
  hf_auth_token = os.getenv("HF_AUTH_TOKEN", False)
19
+ st.write("Using Hugging Face auth token: ", hf_auth_token)
20
+
21
 
22
  MODELS = {
23
  "Indonesian Newspaper - Indonesian GPT-2 Medium": {
 
112
  temperature=temperature,
113
  repetition_penalty=repetition_penalty,
114
  num_return_sequences=1,
115
+ use_auth_token=hf_auth_token
116
  )
117
  result = tokenizer.decode(sample_outputs[0], skip_special_tokens=True)
118
  print(f"result: {result}")