code2lora commited on
Commit
a3d7d04
·
verified ·
1 Parent(s): 230946e

Wider prediction column; dtype kwarg

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. requirements.txt +1 -1
app.py CHANGED
@@ -90,7 +90,7 @@ class Engine:
90
  if self.tok.pad_token is None:
91
  self.tok.pad_token = self.tok.eos_token
92
  self.bos = self.tok.bos_token_id if self.tok.bos_token_id is not None else self.tok.eos_token_id
93
- self.model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, torch_dtype=DTYPE).to(DEVICE).eval()
94
 
95
  path = hf_hub_download(CKPT_REPO, CKPT_FILE)
96
  try:
@@ -455,8 +455,8 @@ CSS = """
455
  .bars .bar i {height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6d7cff, #22d3b6)}
456
  table.preds {width: 100%; border-collapse: collapse; margin-top: 6px}
457
  table.preds td {padding: 8px 10px; border-bottom: 1px solid #eef0f5; vertical-align: top}
458
- table.preds td.who {width: 170px; font-weight: 600; white-space: nowrap}
459
- table.preds td.note {color: #8a91a5; font-size: 0.82rem}
460
  table.preds tr.truth {background: #f7f8fb}
461
  table.preds tr.c2l {background: #f4f5ff}
462
  table.preds tr.prev {background: #fffaf2}
 
90
  if self.tok.pad_token is None:
91
  self.tok.pad_token = self.tok.eos_token
92
  self.bos = self.tok.bos_token_id if self.tok.bos_token_id is not None else self.tok.eos_token_id
93
+ self.model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, dtype=DTYPE).to(DEVICE).eval()
94
 
95
  path = hf_hub_download(CKPT_REPO, CKPT_FILE)
96
  try:
 
455
  .bars .bar i {height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6d7cff, #22d3b6)}
456
  table.preds {width: 100%; border-collapse: collapse; margin-top: 6px}
457
  table.preds td {padding: 8px 10px; border-bottom: 1px solid #eef0f5; vertical-align: top}
458
+ table.preds td.who {width: 150px; font-weight: 600; white-space: nowrap}
459
+ table.preds td.note {width: 130px; color: #8a91a5; font-size: 0.8rem}
460
  table.preds tr.truth {background: #f7f8fb}
461
  table.preds tr.c2l {background: #f4f5ff}
462
  table.preds tr.prev {background: #fffaf2}
requirements.txt CHANGED
@@ -1,6 +1,6 @@
1
  --extra-index-url https://download.pytorch.org/whl/cpu
2
  torch>=2.3
3
- transformers>=4.45,<5
4
  accelerate>=0.34
5
  huggingface_hub>=0.28
6
  numpy>=1.24
 
1
  --extra-index-url https://download.pytorch.org/whl/cpu
2
  torch>=2.3
3
+ transformers>=4.56,<5
4
  accelerate>=0.34
5
  huggingface_hub>=0.28
6
  numpy>=1.24