jordimas commited on
Commit
9856727
1 Parent(s): 061fed6

Simple inference

Browse files
Files changed (1) hide show
  1. README.md +5 -8
README.md CHANGED
@@ -35,21 +35,18 @@ Usage:
35
 
36
  ```python
37
  import huggingface_hub
 
 
38
 
39
  model_name = "bloomz-7b1"
40
  prompt = "Hello, I am Joan and I am from Barcelona and"
41
 
42
  repo_id = "jordimas/bloom-ctranslate2"
43
- output_dir = "output/"
44
 
45
- kwargs = {
46
- "local_dir" : output_dir,
47
- "local_dir_use_symlinks" : False,
48
- }
49
- huggingface_hub.snapshot_download(repo_id = repo_id, allow_patterns=f"*{model_name}*", **kwargs)
50
 
51
- model = f"{output_dir}{model_name}"
52
- print(f"model: {model}")
53
  generator = ctranslate2.Generator(model, compute_type="int8")
54
  tokenizer = transformers.AutoTokenizer.from_pretrained(model)
55
 
 
35
 
36
  ```python
37
  import huggingface_hub
38
+ import ctranslate2
39
+ import transformers
40
 
41
  model_name = "bloomz-7b1"
42
  prompt = "Hello, I am Joan and I am from Barcelona and"
43
 
44
  repo_id = "jordimas/bloom-ctranslate2"
 
45
 
46
+ snapshot_folder = huggingface_hub.snapshot_download(repo_id = repo_id, allow_patterns=f"*{model_name}*")
47
+ print(f"folder: {snapshot_folder}")
 
 
 
48
 
49
+ model = f"{snapshot_folder}/{model_name}"
 
50
  generator = ctranslate2.Generator(model, compute_type="int8")
51
  tokenizer = transformers.AutoTokenizer.from_pretrained(model)
52