Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -351,6 +351,19 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Text-to-SQL 智能查詢系統") a
|
|
| 351 |
outputs=[sql_output, status_output, log_output]
|
| 352 |
)
|
| 353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 354 |
if __name__ == "__main__":
|
| 355 |
if text_to_sql_system:
|
| 356 |
print("Gradio 介面啟動中...")
|
|
|
|
| 351 |
outputs=[sql_output, status_output, log_output]
|
| 352 |
)
|
| 353 |
|
| 354 |
+
from huggingface_hub import InferenceClient
|
| 355 |
+
import os
|
| 356 |
+
|
| 357 |
+
# 測試列出目前 Hugging Face 免費 API 已部署的模型
|
| 358 |
+
try:
|
| 359 |
+
client = InferenceClient(token=os.environ.get("HF_TOKEN"))
|
| 360 |
+
deployed = client.list_deployed_models("text-generation-inference")
|
| 361 |
+
print("🔍 已部署的 text-generation 模型:")
|
| 362 |
+
for m in deployed.get("text-generation", []):
|
| 363 |
+
print(" -", m)
|
| 364 |
+
except Exception as e:
|
| 365 |
+
print("⚠️ 查詢已部署模型失敗:", e)
|
| 366 |
+
|
| 367 |
if __name__ == "__main__":
|
| 368 |
if text_to_sql_system:
|
| 369 |
print("Gradio 介面啟動中...")
|