Bonosa2 commited on
Commit
6095560
·
verified ·
1 Parent(s): d23d60c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -27,14 +27,14 @@ def generate_and_export():
27
  On button click: lazily load the 8‑bit model, generate 100 doc→SOAP pairs,
28
  split 70/30, run inference & eval, write files, and return download links.
29
  """
30
- # a) Load full model in 8‑bit
31
  model = AutoModelForImageTextToText.from_pretrained(
32
- MODEL_ID,
33
- trust_remote_code=True,
34
- token=HF_TOKEN,
35
- load_in_8bit=True,
36
- device_map="auto"
37
- )
 
38
  device = next(model.parameters()).device
39
 
40
  def to_soap(text: str) -> str:
 
27
  On button click: lazily load the 8‑bit model, generate 100 doc→SOAP pairs,
28
  split 70/30, run inference & eval, write files, and return download links.
29
  """
 
30
  model = AutoModelForImageTextToText.from_pretrained(
31
+ MODEL_ID,
32
+ trust_remote_code=True,
33
+ token=HF_TOKEN,
34
+ torch_dtype=torch.float16, # or torch.float32 if you prefer
35
+ device_map="auto"
36
+ )
37
+
38
  device = next(model.parameters()).device
39
 
40
  def to_soap(text: str) -> str: