PyaeSoneK commited on
Commit
560973c
·
1 Parent(s): 5ed70b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
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
- with init_empty_weights():
15
- model = AutoModelForCausalLM.from_pretrained("PyaeSoneK/LlamaV2LegalFineTuned",
16
  device_map='auto',
17
  torch_dtype=torch.float16,
18
  use_auth_token= st.secrets['hf_access_token'],
19
  )
20
 
21
- model = load_checkpoint_and_dispatch(
22
- model, checkpoint=checkpoint_file, device_map="auto"
23
- )
24
  # load_in_4bit=True
25
 
26
- tokenizer = AutoTokenizer.from_pretrained("PyaeSoneK/LlamaV2LegalFineTuned",
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
- from transformers import AutoTokenizer, AutoModelForCausalLM
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"