DeepLearning101
commited on
Commit
•
aa64435
1
Parent(s):
0954f3f
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,18 @@ from functools import lru_cache
|
|
7 |
from datasets import Dataset, DatasetDict, load_dataset
|
8 |
from huggingface_hub import HfFolder
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# 從環境變量中獲取 Hugging Face API 令牌和其他配置
|
11 |
HF_API_TOKEN = os.environ.get("Feedback_API_TOKEN")
|
12 |
LLM_API = os.environ.get("LLM_API")
|
|
|
7 |
from datasets import Dataset, DatasetDict, load_dataset
|
8 |
from huggingface_hub import HfFolder
|
9 |
|
10 |
+
import subprocess
|
11 |
+
|
12 |
+
def upgrade_pip():
|
13 |
+
try:
|
14 |
+
subprocess.check_call([os.sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
|
15 |
+
print("pip 升級成功")
|
16 |
+
except subprocess.CalledProcessError:
|
17 |
+
print("pip 升級失敗")
|
18 |
+
|
19 |
+
# 呼叫升級函數
|
20 |
+
upgrade_pip()
|
21 |
+
|
22 |
# 從環境變量中獲取 Hugging Face API 令牌和其他配置
|
23 |
HF_API_TOKEN = os.environ.get("Feedback_API_TOKEN")
|
24 |
LLM_API = os.environ.get("LLM_API")
|