add email test code
This commit is contained in:
@@ -39,7 +39,8 @@ def compute_embeddings(chunks: List[str], model_name: str) -> np.ndarray:
|
||||
model = model.to("mps")
|
||||
|
||||
# Generate embeddings
|
||||
embeddings = model.encode(chunks, convert_to_numpy=True, show_progress_bar=True, batch_size=64)
|
||||
# give use an warning if OOM here means we need to turn down the batch size
|
||||
embeddings = model.encode(chunks, convert_to_numpy=True, show_progress_bar=True, batch_size=256)
|
||||
|
||||
return embeddings
|
||||
|
||||
|
||||
@@ -209,10 +209,13 @@ def get_llm(llm_config: Optional[Dict[str, Any]] = None) -> LLMInterface:
|
||||
An instance of an LLMInterface subclass.
|
||||
"""
|
||||
if llm_config is None:
|
||||
logger.info("No LLM config provided, defaulting to simulated chat.")
|
||||
return SimulatedChat()
|
||||
llm_config = {
|
||||
"type": "openai",
|
||||
"model": "gpt-4o",
|
||||
"api_key": os.getenv("OPENAI_API_KEY")
|
||||
}
|
||||
|
||||
llm_type = llm_config.get("type", "simulated")
|
||||
llm_type = llm_config.get("type", "openai")
|
||||
model = llm_config.get("model")
|
||||
|
||||
logger.info(f"Attempting to create LLM of type='{llm_type}' with model='{model}'")
|
||||
|
||||
Reference in New Issue
Block a user