pp3232133 commited on
Commit
56014e4
·
1 Parent(s): 777e78d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,15 +10,15 @@ with open("config.txt", "r") as f:
10
  key, value = line.strip().split(" = ")
11
  config[key] = value
12
 
13
- repo_id = config["repo_id", ""]
14
- repo_type = config["repo_type", ""]
15
- token = config["token", ""]
16
 
17
  # Utworzenie folderu Hugging Face z tokenem uwierzytelniającym
18
  hf_folder = HfFolder(repo_id, repo_type, token=token)
19
 
20
  # Wczytanie własnego modelu chatbota z Hugging Face
21
- model_name == "pp3232133/pp3232133-distilgpt2-wikitext2"
22
  tokenizer = AutoTokenizer.from_pretrained(model_name, repo_path=hf_folder)
23
  model = AutoModelForCausalLM.from_pretrained(model_name, repo_path=hf_folder)
24
 
 
10
  key, value = line.strip().split(" = ")
11
  config[key] = value
12
 
13
+ model_name = config.get("repo_id", "")
14
+ repo_type = config.get("repo_type", "")
15
+ token = config.get("token", "")
16
 
17
  # Utworzenie folderu Hugging Face z tokenem uwierzytelniającym
18
  hf_folder = HfFolder(repo_id, repo_type, token=token)
19
 
20
  # Wczytanie własnego modelu chatbota z Hugging Face
21
+ if model_name == "pp3232133/pp3232133-distilgpt2-wikitext2"
22
  tokenizer = AutoTokenizer.from_pretrained(model_name, repo_path=hf_folder)
23
  model = AutoModelForCausalLM.from_pretrained(model_name, repo_path=hf_folder)
24