Spaces:
Running
Running
Commit
·
1d7a679
1
Parent(s):
4413ea6
app: auto--initilize the agent
Browse files
app.py
CHANGED
|
@@ -50,15 +50,8 @@ with gr.Blocks() as demo:
|
|
| 50 |
gr.Markdown("# Stock Analysis Agent")
|
| 51 |
# State to store the RAG instance
|
| 52 |
message, stock_analyst = initialize()
|
| 53 |
-
agent_instance = gr.State(
|
| 54 |
-
|
| 55 |
-
init_button = gr.Button("Initialize")
|
| 56 |
-
# Event handlers
|
| 57 |
-
init_button.click(
|
| 58 |
-
initialize,
|
| 59 |
-
outputs=[init_status, agent_instance] # Output: status message and the RAG instance
|
| 60 |
-
)
|
| 61 |
-
# gr.Text(label='Status', value=message)
|
| 62 |
# TickerFinder tool
|
| 63 |
ticker_to_find = gr.Textbox(label="Ticker Finder: not sure what's the stock ticker symbol? Enter the company name you want to analyze, and I will try to help.")
|
| 64 |
tf_output = gr.Markdown(label="Match Results")
|
|
@@ -87,6 +80,8 @@ with gr.Blocks() as demo:
|
|
| 87 |
|
| 88 |
|
| 89 |
if __name__ == "__main__":
|
| 90 |
-
#
|
| 91 |
-
demo.launch(
|
|
|
|
|
|
|
| 92 |
|
|
|
|
| 50 |
gr.Markdown("# Stock Analysis Agent")
|
| 51 |
# State to store the RAG instance
|
| 52 |
message, stock_analyst = initialize()
|
| 53 |
+
agent_instance = gr.State(stock_analyst)
|
| 54 |
+
print('Agent initialized successfully')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# TickerFinder tool
|
| 56 |
ticker_to_find = gr.Textbox(label="Ticker Finder: not sure what's the stock ticker symbol? Enter the company name you want to analyze, and I will try to help.")
|
| 57 |
tf_output = gr.Markdown(label="Match Results")
|
|
|
|
| 80 |
|
| 81 |
|
| 82 |
if __name__ == "__main__":
|
| 83 |
+
# local:
|
| 84 |
+
# demo.launch()
|
| 85 |
+
# on HuggingFace:
|
| 86 |
+
demo.launch(share=True, ssr_mode=False)
|
| 87 |
|