MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / move_to

Function move_to

eval/run_predict_aguvis.py:431–449  ·  view source on GitHub ↗

Move the model to the specified device. Args: device (str): The device to move the model to. Returns: None

(device)

Source from the content-addressed store, hash-verified

429
430
431def move_to(device):
432 """
433 Move the model to the specified device.
434
435 Args:
436 device (str): The device to move the model to.
437
438 Returns:
439 None
440 """
441 global _llm,_tokenizer
442 if _llm is None:
443 raise ValueError("Error, LLM is not initialized.")
444 _llm = _llm.to(device)
445 if _processor is None:
446 raise ValueError("Error, Processor is not initialized.")
447 if _tokenizer is None:
448 raise ValueError("Error, Tokenizer is not initialized.")
449 return f"Moved to {device}"
450
451
452def process_data(episode:Dict,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected