Update app.py
Browse files
app.py
CHANGED
|
@@ -641,10 +641,9 @@ def build_demo():
|
|
| 641 |
return demo
|
| 642 |
# --- API endpoint: /chat ---
|
| 643 |
|
| 644 |
-
def http_api_infer(question: str
|
| 645 |
-
|
| 646 |
-
|
| 647 |
-
return "❌ Unauthorized: Invalid token."
|
| 648 |
|
| 649 |
dummy_state = init_state()
|
| 650 |
dummy_state.set_system_message("You are a helpful assistant.")
|
|
@@ -688,6 +687,7 @@ api_interface = gr.Interface(
|
|
| 688 |
)
|
| 689 |
|
| 690 |
|
|
|
|
| 691 |
if __name__ == "__main__":
|
| 692 |
parser = argparse.ArgumentParser()
|
| 693 |
parser.add_argument("--host", type=str, default="0.0.0.0")
|
|
|
|
| 641 |
return demo
|
| 642 |
# --- API endpoint: /chat ---
|
| 643 |
|
| 644 |
+
def http_api_infer(question: str):
|
| 645 |
+
# NOTE: No request here – Gradio will not inject it automatically
|
| 646 |
+
# So remove token checking (or add later via FastAPI if needed)
|
|
|
|
| 647 |
|
| 648 |
dummy_state = init_state()
|
| 649 |
dummy_state.set_system_message("You are a helpful assistant.")
|
|
|
|
| 687 |
)
|
| 688 |
|
| 689 |
|
| 690 |
+
|
| 691 |
if __name__ == "__main__":
|
| 692 |
parser = argparse.ArgumentParser()
|
| 693 |
parser.add_argument("--host", type=str, default="0.0.0.0")
|