MCPcopy Index your code
hub / github.com/PaddlePaddle/FastDeploy / _load_from_version_file

Method _load_from_version_file

fastdeploy/config.py:1605–1626  ·  view source on GitHub ↗

Internal method to load version info from file

(self, file_path: str = None)

Source from the content-addressed store, hash-verified

1603 self._load_from_version_file()
1604
1605 def _load_from_version_file(self, file_path: str = None):
1606 """Internal method to load version info from file"""
1607 if file_path is None:
1608 file_path = os.path.join(fastdeploy.__path__[0], "version.txt")
1609 try:
1610 with open(file_path, "r") as f:
1611 for line in f:
1612 line = line.strip()
1613 if line.startswith("fastdeploy GIT COMMIT ID:"):
1614 self.fastdeploy_commit = line.split(":")[1].strip()
1615 elif line.startswith("Paddle version:"):
1616 self.paddle_version = line.split(":")[1].strip()
1617 elif line.startswith("Paddle GIT COMMIT ID:"):
1618 self.paddle_commit = line.split(":")[1].strip()
1619 elif line.startswith("CUDA version:"):
1620 self.cuda_version = line.split(":")[1].strip()
1621 elif line.startswith("CXX compiler version:"):
1622 self.compiler_version = line.split(":")[1].strip()
1623 except FileNotFoundError:
1624 logger.info(f"Warning: Version file not found at {file_path}")
1625 except Exception as e:
1626 logger.info(f"Warning: Could not read version file - {e!s}")
1627
1628 def print(self):
1629 """

Callers 1

__init__Method · 0.95

Calls 3

joinMethod · 0.80
splitMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected