schuler commited on
Commit
b1aa907
·
verified ·
1 Parent(s): 7b29192

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -9
README.md CHANGED
@@ -10,27 +10,25 @@ datasets:
10
 
11
  UNDER CONSTRUCTION
12
 
13
- You can test this model at: https://huggingface.co/spaces/schuler/experimental-kphi-3-nano-4k-instruct-gradio-autoloader .
 
 
14
 
15
  ## Usage:
16
  ```
17
  from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig, pipeline
 
18
  import torch
19
 
20
  REPO_NAME = 'schuler/experimental-JP47D20'
21
 
22
- # How to cache?
23
- @spaces.GPU()
24
  def load_model(repo_name):
25
- tokenizer = AutoTokenizer.from_pretrained(repo_name, trust_remote_code=True)
26
- generator_conf = GenerationConfig.from_pretrained(repo_name)
27
- model = AutoModelForCausalLM.from_pretrained(repo_name, trust_remote_code=True, torch_dtype=torch.bfloat16, attn_implementation="eager")
28
  # model.to('cuda')
29
  return tokenizer, generator_conf, model
30
 
31
- # tokenizer, generator_conf, model, generator = False, False, False, False
32
- # with gr.Blocks() as main_block:
33
-
34
  tokenizer, generator_conf, model = load_model(REPO_NAME)
35
  global_error = ''
36
  try:
 
10
 
11
  UNDER CONSTRUCTION
12
 
13
+ You can test this model at:
14
+ * https://huggingface.co/spaces/schuler/experimental-kphi-3-nano-4k-instruct-gradio-autoloader .
15
+ * https://huggingface.co/spaces/schuler/experimental-KPhi-3-nano-4k-instruct .
16
 
17
  ## Usage:
18
  ```
19
  from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig, pipeline
20
+ from transformers import LlamaTokenizer
21
  import torch
22
 
23
  REPO_NAME = 'schuler/experimental-JP47D20'
24
 
 
 
25
  def load_model(repo_name):
26
+ tokenizer = LlamaTokenizer.from_pretrained(REPO_NAME, trust_remote_code=True)
27
+ generator_conf = GenerationConfig.from_pretrained(REPO_NAME)
28
+ model = AutoModelForCausalLM.from_pretrained(REPO_NAME, trust_remote_code=True, torch_dtype=torch.bfloat16, attn_implementation="eager")
29
  # model.to('cuda')
30
  return tokenizer, generator_conf, model
31
 
 
 
 
32
  tokenizer, generator_conf, model = load_model(REPO_NAME)
33
  global_error = ''
34
  try: