Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ processor = AutoProcessor.from_pretrained(MODEL_ID, token=HF_TOKEN)
|
|
| 36 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 37 |
MODEL_ID,
|
| 38 |
device_map="auto",
|
| 39 |
-
torch_dtype=torch.
|
| 40 |
token=HF_TOKEN,
|
| 41 |
)
|
| 42 |
model.generation_config.do_sample = True
|
|
@@ -218,7 +218,7 @@ def _generate_report_impl(
|
|
| 218 |
tokenize=True,
|
| 219 |
return_dict=True,
|
| 220 |
return_tensors="pt"
|
| 221 |
-
).to(device=model.device, dtype=torch.
|
| 222 |
|
| 223 |
input_len = inputs["input_ids"].shape[-1]
|
| 224 |
print(f"Input sequence length: {input_len}")
|
|
|
|
| 36 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 37 |
MODEL_ID,
|
| 38 |
device_map="auto",
|
| 39 |
+
torch_dtype=torch.bfloat16,
|
| 40 |
token=HF_TOKEN,
|
| 41 |
)
|
| 42 |
model.generation_config.do_sample = True
|
|
|
|
| 218 |
tokenize=True,
|
| 219 |
return_dict=True,
|
| 220 |
return_tensors="pt"
|
| 221 |
+
).to(device=model.device, dtype=torch.bfloat16)
|
| 222 |
|
| 223 |
input_len = inputs["input_ids"].shape[-1]
|
| 224 |
print(f"Input sequence length: {input_len}")
|