File size: 486 Bytes
12a01f5
 
f0d751a
08abd4c
12a01f5
f0d751a
 
 
 
 
 
 
12a01f5
f0d751a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from gradio_client import Client

# 初始化客户端连接到 Qwen API
client = Client("https://qwen-qwen-72b-chat-demo.hf.space/--replicas/ypz66/")

# 发送请求并获取结果
result = client.predict(
    "Hello!!",  # 输入 'Input' Textbox 组件中的内容
    [["Hello!", None]],  # Chatbot 输入的内容(Tuple 格式)
    "Hello!!",  # 作为 'parameter_9' 组件的文本内容
    api_name="/model_chat"  # 指定 API 名称
)

# 打印返回的结果
print(result)