llk010502 commited on
Commit
2c4a79c
1 Parent(s): 3cec35e

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -0
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Inference
2
+ ``` python
3
+ from transformers import AutoModel, AutoTokenizer, AutoModelForCausalLM
4
+ from peft import PeftModel
5
+
6
+ model = "meta-llama/Llama-2-7b-chat-hf"
7
+
8
+ tokenizer = AutoTokenizer.from_pretrained(model, trust_remote_code=True)
9
+
10
+ model = AutoModelForCausalLM.from_pretrained(model, trust_remote_code=True, device_map = 'cuda')
11
+ model = PeftModel.from_pretrained(model, "FinGPT/fingpt-forecaster_sz50_llama2-7B_lora")
12
+
13
+ model = model.eval()
14
+ ```