Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,17 +14,16 @@ from collections import defaultdict
|
|
14 |
from datetime import date, datetime, timedelta
|
15 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
|
16 |
|
17 |
-
os.environ['HF_HOME'] = '/data/.huggingface'
|
18 |
|
19 |
-
access_token = "
|
20 |
-
|
21 |
-
finnhub_client = finnhub.Client(api_key="ckrn2mpr01qiu0ijr9hgckrn2mpr01qiu0ijr9i0")
|
22 |
|
23 |
base_model = AutoModelForCausalLM.from_pretrained(
|
24 |
'meta-llama/Llama-2-7b-chat-hf',
|
25 |
token=access_token,
|
26 |
trust_remote_code=True,
|
27 |
device_map="auto",
|
|
|
28 |
offload_folder="offload/"
|
29 |
)
|
30 |
model = PeftModel.from_pretrained(
|
@@ -32,11 +31,8 @@ model = PeftModel.from_pretrained(
|
|
32 |
'FinGPT/fingpt-forecaster_dow30_llama2-7b_lora',
|
33 |
offload_folder="offload/"
|
34 |
)
|
35 |
-
model = model.half()
|
36 |
model = model.eval()
|
37 |
|
38 |
-
print_gpu_utilization()
|
39 |
-
|
40 |
tokenizer = AutoTokenizer.from_pretrained(
|
41 |
'meta-llama/Llama-2-7b-chat-hf',
|
42 |
token=access_token
|
|
|
14 |
from datetime import date, datetime, timedelta
|
15 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
|
16 |
|
|
|
17 |
|
18 |
+
access_token = os.environ["HF_TOKEN"]
|
19 |
+
finnhub_client = finnhub.Client(api_key=os.environ["FINNHUB_API_KEY"])
|
|
|
20 |
|
21 |
base_model = AutoModelForCausalLM.from_pretrained(
|
22 |
'meta-llama/Llama-2-7b-chat-hf',
|
23 |
token=access_token,
|
24 |
trust_remote_code=True,
|
25 |
device_map="auto",
|
26 |
+
torch_dtype=torch.float16,
|
27 |
offload_folder="offload/"
|
28 |
)
|
29 |
model = PeftModel.from_pretrained(
|
|
|
31 |
'FinGPT/fingpt-forecaster_dow30_llama2-7b_lora',
|
32 |
offload_folder="offload/"
|
33 |
)
|
|
|
34 |
model = model.eval()
|
35 |
|
|
|
|
|
36 |
tokenizer = AutoTokenizer.from_pretrained(
|
37 |
'meta-llama/Llama-2-7b-chat-hf',
|
38 |
token=access_token
|