Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ class HFEmbedder(nn.Module):
|
|
| 40 |
|
| 41 |
def load_t5(device: str | torch.device = "cuda", max_length: int = 512) -> HFEmbedder:
|
| 42 |
# max length 64, 128, 256 and 512 should work (if your sequence is short enough)
|
| 43 |
-
return HFEmbedder("
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
| 46 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 40 |
|
| 41 |
def load_t5(device: str | torch.device = "cuda", max_length: int = 512) -> HFEmbedder:
|
| 42 |
# max length 64, 128, 256 and 512 should work (if your sequence is short enough)
|
| 43 |
+
return HFEmbedder("city96/t5-v1_1-xxl-encoder-bf16", max_length=max_length, torch_dtype=torch.bfloat16).to(device)
|
| 44 |
|
| 45 |
if __name__ == "__main__":
|
| 46 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|