LovnishVerma commited on
Commit
f235b5d
1 Parent(s): 86d0067

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,8 +1,11 @@
1
- from transformers import AutoModelForCausalLM, AutoTokenizer
2
 
3
  model_name = "mlabonne/llama-2-7b-guanaco"
4
 
5
- try:
6
- model = AutoModelForCausalLM.from_pretrained(model_name, use_auth_token=False, device='cpu', memory_limit=1024*16)
7
- except Exception as e:
8
- print(f"Error loading the model: {e}")
 
 
 
 
1
+ from transformers import LlamaForCausalLM, LlamaTokenizer
2
 
3
  model_name = "mlabonne/llama-2-7b-guanaco"
4
 
5
+ # Load the model
6
+ model = LlamaForCausalLM.from_pretrained(model_name)
7
+
8
+ # Load the tokenizer
9
+ tokenizer = LlamaTokenizer.from_pretrained(model_name)
10
+
11
+ # Now, you can use the model and tokenizer as needed