vilarin commited on
Commit
5c6879a
Β·
verified Β·
1 Parent(s): b54c169

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -31,7 +31,6 @@ CSS = """
31
  """
32
 
33
  filenames = [
34
- ".gitattributes",
35
  "generation_config.json",
36
  "model-00001-of-00004.safetensors",
37
  "model-00002-of-00004.safetensors",
@@ -47,7 +46,7 @@ for filename in filenames:
47
  downloaded_model_path = hf_hub_download(
48
  repo_id=MODEL_ID,
49
  filename=filename,
50
- local_dir="model"
51
  )
52
 
53
  # def no_logger():
@@ -57,15 +56,14 @@ for filename in filenames:
57
  # })
58
 
59
 
60
- # List of domains
61
 
62
  model = AutoModelForCausalLM.from_pretrained(
63
- '/path/to/model/',
64
  torch_dtype=torch.float16,
65
  low_cpu_mem_usage=True,
66
- local_files_only=True
67
  ).to(0)
68
- tokenizer = AutoTokenizer.from_pretrained('/path/to/model/',local_files_only=True)
69
  vision_tower = model.get_vision_tower()
70
  vision_tower.load_model()
71
  vision_tower.to(device="cuda", dtype=torch.float16)
 
31
  """
32
 
33
  filenames = [
 
34
  "generation_config.json",
35
  "model-00001-of-00004.safetensors",
36
  "model-00002-of-00004.safetensors",
 
46
  downloaded_model_path = hf_hub_download(
47
  repo_id=MODEL_ID,
48
  filename=filename,
49
+ local_dir="./model/"
50
  )
51
 
52
  # def no_logger():
 
56
  # })
57
 
58
 
59
+ MODEL_PATH = os.path.expanduser(
60
 
61
  model = AutoModelForCausalLM.from_pretrained(
62
+ './model',
63
  torch_dtype=torch.float16,
64
  low_cpu_mem_usage=True,
 
65
  ).to(0)
66
+ tokenizer = AutoTokenizer.from_pretrained('./model')
67
  vision_tower = model.get_vision_tower()
68
  vision_tower.load_model()
69
  vision_tower.to(device="cuda", dtype=torch.float16)