Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
# 使用 Hugging Face Inference API 调用云端模型(无需本地加载)
|
5 |
-
|
|
|
|
|
6 |
|
7 |
def medical_chat(user_input, history):
|
8 |
# 构建医学对话 prompt
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
|
4 |
# 使用 Hugging Face Inference API 调用云端模型(无需本地加载)
|
5 |
+
# 正确方法1:从环境变量读取
|
6 |
+
import os
|
7 |
+
client = InferenceClient(token=os.environ["HF_TOKEN"])
|
8 |
|
9 |
def medical_chat(user_input, history):
|
10 |
# 构建医学对话 prompt
|