Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
shigeki Ishida
commited on
Commit
·
08d1517
1
Parent(s):
3cb0a6a
Add vllm version fetching from GitHub API
Browse files- src/envs.py +13 -1
src/envs.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
|
|
|
3 |
from huggingface_hub import HfApi
|
4 |
|
5 |
# Info to change for your repository
|
@@ -22,7 +23,18 @@ EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval-results")
|
|
22 |
EVAL_REQUESTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-queue-bk")
|
23 |
EVAL_RESULTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-results-bk")
|
24 |
|
|
|
25 |
# vllm version
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
API = HfApi(token=TOKEN)
|
|
|
1 |
import os
|
2 |
|
3 |
+
import requests
|
4 |
from huggingface_hub import HfApi
|
5 |
|
6 |
# Info to change for your repository
|
|
|
23 |
EVAL_REQUESTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-queue-bk")
|
24 |
EVAL_RESULTS_PATH_BACKEND = os.path.join(CACHE_PATH, "eval-results-bk")
|
25 |
|
26 |
+
|
27 |
# vllm version
|
28 |
+
def get_latest_vllm_version() -> str:
|
29 |
+
"""GitHubからvllmの最新バージョンを取得する"""
|
30 |
+
url = "https://api.github.com/repos/vllm-project/vllm/releases/latest"
|
31 |
+
response = requests.get(url)
|
32 |
+
if response.status_code == 200:
|
33 |
+
latest_release = response.json()
|
34 |
+
return latest_release["tag_name"]
|
35 |
+
return None # APIリクエストが失敗した場合はNoneを返す
|
36 |
+
|
37 |
+
|
38 |
+
VLLM_CURRENT_VERSION = get_latest_vllm_version()
|
39 |
|
40 |
API = HfApi(token=TOKEN)
|