sweetssweets commited on
Commit
9dd8fce
·
verified ·
1 Parent(s): 359f08c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -27,14 +27,14 @@ def NMRExtractor(Paragraph, max_length):
27
  model_path = f"sweetssweets/NMRExtractor"
28
  model = AutoModelForCausalLM.from_pretrained(
29
  model_path,
30
- low_cpu_mem_usage = True,
31
  return_dict = True,
32
- torch_dtype = torch.float16,
33
  device_map = device,
34
  )
35
 
36
  # Reload tokenizer to save it
37
- tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True,truncation = True)
38
  tokenizer.pad_token = tokenizer.eos_token
39
  tokenizer.padding_side = "right"
40
 
@@ -97,7 +97,7 @@ demo = gr.Interface(
97
  article = 'https://github.com/.../NMRExtractor',
98
 
99
  examples=[
100
- [ "Description of 5-(4-(3-chloro-5-(trifluoromethyl)pyridin-2-yl)phenoxy)-N-(2,4-difluorophenyl)-2-nitrobenzamide (5i): White solid, yield 78.1%. m.p. 159.1–161.5 °C; 1H NMR (400 MHz, CDCl3) δ 8.84 (s, 1H), 8.25 (s, 1H), 8.09 (dd, J = 5.1, 3.7 Hz, 2H), 7.86 (d, J = 8.6 Hz, 2H), 7.52 (s, 1H), 7.42 (d, J = 8.1 Hz, 1H), 7.33 (t, J = 8.2 Hz, 1H), 7.22 (d, J = 8.5 Hz, 2H), 7.15–7.10 (m, 2H), 7.02 (d, J = 8.1 Hz, 1H); 13C NMR (101 MHz, CDCl3) δ 163.78, 162.18, 158.52, 155.36, 144.36, 140.24, 135.60, 134.94, 134.50, 131.93, 130.20, 127.62, 126.25, 123.49, 123.38, 120.21, 118.70, 116.89, 111.70, 111.48, 103.80. HRMS calcd. for C25H13ClF5N3O4 [M–H]− 548.0422, found 548.0422.", 1024],
101
  #[ "Compound 11 (Supplementary Figures S24 and S25): Light yellow oil. ESI-MS m/z: 259 [M + H]+. 1H-NMR (700 MHz, CD3OD) δ: 7.86 (1H, d, J = 1.2 Hz, H-6), 5.91 (1H, d, J = 4.7 Hz, H-1′), 4.20 − 4.16 (2H, m, H-2′, 3′), 4.00 (1H, dt, J = 4.2, 2.9 Hz, H-4′), 3.86 (1H, dd, J = 12.2, 2.7 Hz, H-5’a), 3.75 (1H, dd, J = 12.2, 3.0 Hz, H-5’b), 1.89 (3H, d, J = 1.2 Hz, 5-Me); 13C-NMR (175 MHz, CD3OD) δ: 166.4 (C-4), 152.7 (C-2), 138.4 (C-6), 111.5 (C-5), 90.4 (C-1′), 86.3 (C-4′), 75.5 (C-2′), 71.3 (C-3′), 62.3 (C-5′), and 12.4 (5-Me). The above data are in general agreement with the NMR data reported in the literature, so the compound was identified as 1-(β-D-ribofuranosyl)thymine [38].", 1024]
102
  ],
103
  )
 
27
  model_path = f"sweetssweets/NMRExtractor"
28
  model = AutoModelForCausalLM.from_pretrained(
29
  model_path,
30
+ #low_cpu_mem_usage = True,
31
  return_dict = True,
32
+ torch_dtype = torch.bfloat16,
33
  device_map = device,
34
  )
35
 
36
  # Reload tokenizer to save it
37
+ tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
38
  tokenizer.pad_token = tokenizer.eos_token
39
  tokenizer.padding_side = "right"
40
 
 
97
  article = 'https://github.com/.../NMRExtractor',
98
 
99
  examples=[
100
+ [ "Description of 5-(4-(3-chloro-5-(trifluoromethyl)pyridin-2-yl)phenoxy)-N-(2,4-difluorophenyl)-2-nitrobenzamide (5i): White solid, yield 78.1%. m.p. 159.1–161.5 °C; 1H NMR (400 MHz, CDCl3) δ 8.84 (s, 1H), 8.25 (s, 1H), 8.09 (dd, J = 5.1, 3.7 Hz, 2H), 7.86 (d, J = 8.6 Hz, 2H), 7.52 (s, 1H), 7.42 (d, J = 8.1 Hz, 1H), 7.33 (t, J = 8.2 Hz, 1H), 7.22 (d, J = 8.5 Hz, 2H), 7.15–7.10 (m, 2H), 7.02 (d, J = 8.1 Hz, 1H); 13C NMR (101 MHz, CDCl3) δ 163.78, 162.18, 158.52, 155.36, 144.36, 140.24, 135.60, 134.94, 134.50, 131.93, 130.20, 127.62, 126.25, 123.49, 123.38, 120.21, 118.70, 116.89, 111.70, 111.48, 103.80. HRMS calcd. for C25H13ClF5N3O4 [M–H]− 548.0422, found 548.0422.", 513],
101
  #[ "Compound 11 (Supplementary Figures S24 and S25): Light yellow oil. ESI-MS m/z: 259 [M + H]+. 1H-NMR (700 MHz, CD3OD) δ: 7.86 (1H, d, J = 1.2 Hz, H-6), 5.91 (1H, d, J = 4.7 Hz, H-1′), 4.20 − 4.16 (2H, m, H-2′, 3′), 4.00 (1H, dt, J = 4.2, 2.9 Hz, H-4′), 3.86 (1H, dd, J = 12.2, 2.7 Hz, H-5’a), 3.75 (1H, dd, J = 12.2, 3.0 Hz, H-5’b), 1.89 (3H, d, J = 1.2 Hz, 5-Me); 13C-NMR (175 MHz, CD3OD) δ: 166.4 (C-4), 152.7 (C-2), 138.4 (C-6), 111.5 (C-5), 90.4 (C-1′), 86.3 (C-4′), 75.5 (C-2′), 71.3 (C-3′), 62.3 (C-5′), and 12.4 (5-Me). The above data are in general agreement with the NMR data reported in the literature, so the compound was identified as 1-(β-D-ribofuranosyl)thymine [38].", 1024]
102
  ],
103
  )