Create README.md
Browse files
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 |
+
```
|