schuler commited on
Commit
af862b7
1 Parent(s): d4d5ab3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -13,11 +13,11 @@ REPO_NAME = 'schuler/experimental-JP47D21-KPhi-3-micro-4k-instruct'
13
 
14
  # How to cache?
15
  @spaces.GPU()
16
- def load_model(repo_name):
17
- # tokenizer = AutoTokenizer.from_pretrained(REPO_NAME, trust_remote_code=True)
18
- tokenizer = LlamaTokenizer.from_pretrained(REPO_NAME, trust_remote_code=True)
19
- generator_conf = GenerationConfig.from_pretrained(REPO_NAME)
20
- model = AutoModelForCausalLM.from_pretrained(REPO_NAME, trust_remote_code=True, torch_dtype=torch.bfloat16, attn_implementation="eager")
21
  # model.to('cuda')
22
  return tokenizer, generator_conf, model
23
 
 
13
 
14
  # How to cache?
15
  @spaces.GPU()
16
+ def load_model(local_repo_name):
17
+ # tokenizer = AutoTokenizer.from_pretrained(local_repo_name, trust_remote_code=True)
18
+ tokenizer = LlamaTokenizer.from_pretrained(local_repo_name, trust_remote_code=True)
19
+ generator_conf = GenerationConfig.from_pretrained(local_repo_name)
20
+ model = AutoModelForCausalLM.from_pretrained(local_repo_name, trust_remote_code=True, torch_dtype=torch.bfloat16, attn_implementation="eager")
21
  # model.to('cuda')
22
  return tokenizer, generator_conf, model
23