ss900371tw commited on
Commit
2436441
·
verified ·
1 Parent(s): ac08560

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +1 -1
src/streamlit_app.py CHANGED
@@ -299,7 +299,7 @@ with st.sidebar:
299
 
300
  # --- 初始化 Hugging Face LLM Client (已更新,MODEL_ID 作為參數) ---
301
  # 確保 load_inference_client 接受 model_id 作為參數,以利用 Streamlit 的快取機制。
302
- @st.cache_resource(experimental_allow_widgets=True) # 需要允許快取使用 Streamlit widgets
303
  def load_inference_client(model_id):
304
  if not os.environ.get("HF_TOKEN"): return None
305
  try:
 
299
 
300
  # --- 初始化 Hugging Face LLM Client (已更新,MODEL_ID 作為參數) ---
301
  # 確保 load_inference_client 接受 model_id 作為參數,以利用 Streamlit 的快取機制。
302
+ @st.cache_resource
303
  def load_inference_client(model_id):
304
  if not os.environ.get("HF_TOKEN"): return None
305
  try: