Initialize and return a text model. Args: device (str): The device to run the model on. Returns: BGEM3FlagModel: The initialized text model.
(device: str = None)
| 53 | |
| 54 | |
| 55 | def get_text_model(device: str = None) -> BGEM3FlagModel: |
| 56 | """ |
| 57 | Initialize and return a text model. |
| 58 | |
| 59 | Args: |
| 60 | device (str): The device to run the model on. |
| 61 | |
| 62 | Returns: |
| 63 | BGEM3FlagModel: The initialized text model. |
| 64 | """ |
| 65 | return BGEM3FlagModel( |
| 66 | "BAAI/bge-m3", |
| 67 | use_fp16=True, |
| 68 | device=device, |
| 69 | ) |
| 70 | |
| 71 | |
| 72 | def get_image_model(device: str = None): |
no outgoing calls
no test coverage detected