Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -109,11 +109,13 @@ def stream_response(message: Dict[str, Any], history: List[Dict[str, Any]], mode
|
|
| 109 |
yield f"Failed to get response: {e}"
|
| 110 |
|
| 111 |
def build_demo() -> gr.Blocks:
|
|
|
|
| 112 |
textbox = gr.MultimodalTextbox(
|
| 113 |
show_label=False,
|
| 114 |
placeholder="Enter text, or upload one or more images...",
|
| 115 |
file_types=["image"],
|
| 116 |
file_count="multiple",
|
|
|
|
| 117 |
)
|
| 118 |
model_selector = gr.Dropdown(
|
| 119 |
label="Model",
|
|
@@ -127,6 +129,7 @@ def build_demo() -> gr.Blocks:
|
|
| 127 |
fn=stream_response,
|
| 128 |
type="messages",
|
| 129 |
multimodal=True,
|
|
|
|
| 130 |
textbox=textbox,
|
| 131 |
title="Qianfan-VL: Domain-Enhanced Vision-Language Models",
|
| 132 |
description="""**Qianfan-VL** is a series of general-purpose multimodal large language models enhanced for enterprise-level multimodal applications. The models offer deep optimization for high-frequency scenarios in industrial deployment while maintaining strong general capabilities.
|
|
@@ -140,4 +143,4 @@ def main():
|
|
| 140 |
build_demo().launch()
|
| 141 |
|
| 142 |
if __name__ == "__main__":
|
| 143 |
-
main()
|
|
|
|
| 109 |
yield f"Failed to get response: {e}"
|
| 110 |
|
| 111 |
def build_demo() -> gr.Blocks:
|
| 112 |
+
chatbot = gr.Chatbot(type="messages", allow_tags=["think"])
|
| 113 |
textbox = gr.MultimodalTextbox(
|
| 114 |
show_label=False,
|
| 115 |
placeholder="Enter text, or upload one or more images...",
|
| 116 |
file_types=["image"],
|
| 117 |
file_count="multiple",
|
| 118 |
+
max_plain_text_length=32768
|
| 119 |
)
|
| 120 |
model_selector = gr.Dropdown(
|
| 121 |
label="Model",
|
|
|
|
| 129 |
fn=stream_response,
|
| 130 |
type="messages",
|
| 131 |
multimodal=True,
|
| 132 |
+
chatbot=chatbot,
|
| 133 |
textbox=textbox,
|
| 134 |
title="Qianfan-VL: Domain-Enhanced Vision-Language Models",
|
| 135 |
description="""**Qianfan-VL** is a series of general-purpose multimodal large language models enhanced for enterprise-level multimodal applications. The models offer deep optimization for high-frequency scenarios in industrial deployment while maintaining strong general capabilities.
|
|
|
|
| 143 |
build_demo().launch()
|
| 144 |
|
| 145 |
if __name__ == "__main__":
|
| 146 |
+
main()
|