File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- __version__ = "0.0.0.beta13 "
15+ __version__ = "0.0.0.b14 "
1616
17+ import os
1718from typing import Sequence
1819
20+ import requests
1921from llmengine .completion import Completion
2022from llmengine .data_types import (
2123 CancelFineTuneResponse ,
6769 "Model" ,
6870 "UploadFileResponse" ,
6971)
72+
73+
74+ def check_version ():
75+ try :
76+ current_version = __version__
77+ response = requests .get ("https://pypi.org/pypi/scale-llm-engine/json" )
78+ latest_version = response .json ()["info" ]["version" ]
79+
80+ if current_version != latest_version :
81+ print (
82+ f"A newer version ({ latest_version } ) of 'scale-llm-engine' is available. Please upgrade!"
83+ )
84+ print ("To upgrade, run: pip install --upgrade scale-llm-engine" )
85+ print (
86+ "Don't want to see this message? Set the environment variable 'LLM_ENGINE_DISABLE_VERSION_CHECK' to 'true'."
87+ )
88+ except requests .RequestException :
89+ # Handle exceptions related to the request (like timeouts, connection errors, etc.)
90+ print (
91+ "Failed to check for the most recent llm-engine package version. Please check your internet connection."
92+ )
93+ except Exception :
94+ print ("Something went wrong with checking for the most recent llm-engine package version." )
95+
96+
97+ if not os .environ .get ("LLM_ENGINE_DISABLE_VERSION_CHECK" ):
98+ check_version ()
You can’t perform that action at this time.
0 commit comments