load_chat
从与 OpenAI API 聊天兼容的端点加载聊天界面。
import gradio as gr
demo = gr.load_chat("https://:11434/v1", model="deepseek-r1")
demo.launch()
🔗 base_url: str
端点的基本 URL,例如 "https://:11434/v1/"
🔗 model: str
您正在加载的模型的名称,例如 "llama3.2"
🔗 token: str | None
默认 = None
API 令牌或占位符字符串(如果您使用的是本地模型),例如 "ollama"
🔗 file_types: Literal['text_encoded', 'image'] | list[Literal['text_encoded', 'image']] | None
默认值 = "text_encoded"
允许用户上传的文件类型。"text_encoded" 允许上传任何文本编码的文件(它只是附加到提示中),"image" 添加了图像上传支持。设置为 None 以禁用文件上传。
🔗 system_message: str | None
默认 = None
🔗 streaming: bool
默认 = True
🔗 kwargs: <class 'inspect._empty'>
传递给 ChatInterface 以进行自定义的其他关键字参数。