Hunzla commited on
Commit
71c587d
1 Parent(s): e471312

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -5,7 +5,24 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
5
  # Load model and tokenizer
6
  model_name = "meta-llama/Llama-2-7b-chat-hf"
7
  print("started loading model")
8
- model = AutoModelForCausalLM.from_pretrained(model_name)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  print("loaded model")
10
  tokenizer = AutoTokenizer.from_pretrained(model_name)
11
  print("loaded tokenizer")
 
5
  # Load model and tokenizer
6
  model_name = "meta-llama/Llama-2-7b-chat-hf"
7
  print("started loading model")
8
+
9
+ api_token = "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" # Replace with your actual API token
10
+
11
+ model = AutoModelForCausalLM.from_pretrained(
12
+ model_name,
13
+ low_cpu_mem_usage=True,
14
+ return_dict=True,
15
+ torch_dtype=torch.float16,
16
+ revision="main", # Or the desired revision
17
+ auth_token=api_token # Provide the API token here
18
+ )
19
+
20
+ tokenizer = AutoTokenizer.from_pretrained(
21
+ model_name,
22
+ revision="main", # Or the desired revision
23
+ auth_token=api_token # Provide the API token here
24
+ )
25
+
26
  print("loaded model")
27
  tokenizer = AutoTokenizer.from_pretrained(model_name)
28
  print("loaded tokenizer")