Update app.py
Browse files
app.py
CHANGED
@@ -641,13 +641,6 @@ def build_demo():
|
|
641 |
return demo
|
642 |
|
643 |
# --- API endpoint: /chat ---
|
644 |
-
api_interface = gr.Interface(
|
645 |
-
fn=http_api_infer,
|
646 |
-
inputs=[gr.Textbox(label="Question")],
|
647 |
-
outputs="text",
|
648 |
-
api_name="/chat"
|
649 |
-
)
|
650 |
-
|
651 |
|
652 |
def http_api_infer(question: str, request: gr.Request):
|
653 |
token = request.headers.get("x-api-token", "")
|
@@ -701,11 +694,12 @@ if __name__ == "__main__":
|
|
701 |
ui_demo = build_demo()
|
702 |
|
703 |
api_interface = gr.Interface(
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
|
|
709 |
|
710 |
# Serve both under tabs — API tab will be invisible in browser but callable
|
711 |
demo = gr.TabbedInterface(
|
|
|
641 |
return demo
|
642 |
|
643 |
# --- API endpoint: /chat ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
|
645 |
def http_api_infer(question: str, request: gr.Request):
|
646 |
token = request.headers.get("x-api-token", "")
|
|
|
694 |
ui_demo = build_demo()
|
695 |
|
696 |
api_interface = gr.Interface(
|
697 |
+
fn=http_api_infer,
|
698 |
+
inputs=[gr.Textbox(label="Question")],
|
699 |
+
outputs="text",
|
700 |
+
api_name="/chat"
|
701 |
+
)
|
702 |
+
|
703 |
|
704 |
# Serve both under tabs — API tab will be invisible in browser but callable
|
705 |
demo = gr.TabbedInterface(
|