Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,25 +17,26 @@ from datetime import date, datetime, timedelta
|
|
17 |
|
18 |
access_token = os.environ["TOKEN"]
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
model = AutoModelForCausalLM.from_pretrained(model, trust_remote_code=True, token = access_token, load_in_8bit=True, offload_folder="offload/")
|
35 |
-
model = PeftModel.from_pretrained(model, peft_model, offload_folder="offload/")
|
36 |
-
|
37 |
model = model.eval()
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
# Inference Data
|
40 |
# get company news online
|
41 |
|
|
|
17 |
|
18 |
access_token = os.environ["TOKEN"]
|
19 |
|
20 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
21 |
+
'NousResearch/Llama-2-7b-chat-hf',
|
22 |
+
token=access_token,
|
23 |
+
trust_remote_code=True,
|
24 |
+
device_map="auto",
|
25 |
+
load_in_8bit=True,
|
26 |
+
offload_folder="offload/"
|
27 |
+
)
|
28 |
+
model = PeftModel.from_pretrained(
|
29 |
+
base_model,
|
30 |
+
'FinGPT/fingpt-forecaster_dow30_llama2-7b_lora',
|
31 |
+
offload_folder="offload/"
|
32 |
+
)
|
|
|
|
|
|
|
|
|
33 |
model = model.eval()
|
34 |
|
35 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
36 |
+
'NousResearch/Llama-2-7b-chat-hf',
|
37 |
+
token=access_token
|
38 |
+
)
|
39 |
+
|
40 |
# Inference Data
|
41 |
# get company news online
|
42 |
|