hermi612 commited on
Commit
b4329a1
·
verified ·
1 Parent(s): 8ac73de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -2,7 +2,9 @@ import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
  # 使用 Hugging Face Inference API 调用云端模型(无需本地加载)
5
- client = InferenceClient(token="hf_your_token")
 
 
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