Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files
app.py
CHANGED
|
@@ -160,7 +160,7 @@ def predict(message: str, history: List[List[str]], about_me: str) -> str:
|
|
| 160 |
|
| 161 |
demo = gr.ChatInterface.load(
|
| 162 |
predict,
|
| 163 |
-
|
| 164 |
placeholder="Ask me a financial question",
|
| 165 |
label="Financial question",
|
| 166 |
container=False,
|
|
|
|
| 160 |
|
| 161 |
demo = gr.ChatInterface.load(
|
| 162 |
predict,
|
| 163 |
+
textbox=gr.Textbox(
|
| 164 |
placeholder="Ask me a financial question",
|
| 165 |
label="Financial question",
|
| 166 |
container=False,
|
bot.py
CHANGED
|
@@ -63,25 +63,7 @@ def load_bot(
|
|
| 63 |
|
| 64 |
# === Bot Runners ===
|
| 65 |
|
| 66 |
-
@financial_bot.rest_api(keep_warm_seconds=300, loader=load_bot)
|
| 67 |
-
def run(**inputs):
|
| 68 |
-
"""
|
| 69 |
-
Run the bot under the Beam RESTful API endpoint.
|
| 70 |
-
|
| 71 |
-
Args:
|
| 72 |
-
inputs (dict): A dictionary containing the following keys:
|
| 73 |
-
- context: The bot instance.
|
| 74 |
-
- about_me (str): Information about the user.
|
| 75 |
-
- question (str): The user's question.
|
| 76 |
-
- history (list): A list of previous conversations (optional).
|
| 77 |
|
| 78 |
-
Returns:
|
| 79 |
-
str: The bot's response to the user's question.
|
| 80 |
-
"""
|
| 81 |
-
|
| 82 |
-
response = _run(**inputs)
|
| 83 |
-
|
| 84 |
-
return response
|
| 85 |
|
| 86 |
def run_local(
|
| 87 |
about_me: str,
|
|
|
|
| 63 |
|
| 64 |
# === Bot Runners ===
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
def run_local(
|
| 69 |
about_me: str,
|