MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / get_text_model

Function get_text_model

utils/src/model_utils.py:55–69  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

53
54
55def 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
72def get_image_model(device: str = None):

Callers 2

do_generateFunction · 0.90
do_generateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected