Update app.py
Browse files
app.py
CHANGED
|
@@ -11,19 +11,18 @@ from accelerate import init_empty_weights, load_checkpoint_and_dispatch
|
|
| 11 |
# App framework
|
| 12 |
st.title('🦜Seon\'s Legal QA For Dummies 🔗 ')
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
device_map='auto',
|
| 17 |
torch_dtype=torch.float16,
|
| 18 |
use_auth_token= st.secrets['hf_access_token'],
|
| 19 |
)
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
)
|
| 24 |
# load_in_4bit=True
|
| 25 |
|
| 26 |
-
tokenizer = AutoTokenizer.from_pretrained("PyaeSoneK/
|
| 27 |
use_auth_token=st.secrets['hf_access_token'],)
|
| 28 |
|
| 29 |
# Use a pipeline for later
|
|
@@ -44,7 +43,7 @@ pipe = pipeline("text-generation",
|
|
| 44 |
import json
|
| 45 |
import textwrap
|
| 46 |
import torch
|
| 47 |
-
|
| 48 |
|
| 49 |
B_INST, E_INST = "[INST]", "[/INST]"
|
| 50 |
B_SYS, E_SYS = "<>\n", "\n<>\n\n"
|
|
|
|
| 11 |
# App framework
|
| 12 |
st.title('🦜Seon\'s Legal QA For Dummies 🔗 ')
|
| 13 |
|
| 14 |
+
|
| 15 |
+
model = AutoModelForCausalLM.from_pretrained("PyaeSoneK/pythia_70m_legalQA",
|
| 16 |
device_map='auto',
|
| 17 |
torch_dtype=torch.float16,
|
| 18 |
use_auth_token= st.secrets['hf_access_token'],
|
| 19 |
)
|
| 20 |
|
| 21 |
+
|
| 22 |
+
|
|
|
|
| 23 |
# load_in_4bit=True
|
| 24 |
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained("PyaeSoneK/pythia_70m_legalQA",
|
| 26 |
use_auth_token=st.secrets['hf_access_token'],)
|
| 27 |
|
| 28 |
# Use a pipeline for later
|
|
|
|
| 43 |
import json
|
| 44 |
import textwrap
|
| 45 |
import torch
|
| 46 |
+
|
| 47 |
|
| 48 |
B_INST, E_INST = "[INST]", "[/INST]"
|
| 49 |
B_SYS, E_SYS = "<>\n", "\n<>\n\n"
|