Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
|
|
2 |
from langchain_groq import ChatGroq
|
3 |
import yfinance as yf
|
4 |
|
5 |
-
# Initialize the ChatGroq model
|
6 |
-
llm = ChatGroq(model_name="Llama3-8b-8192", api_key=groq_api_key)
|
7 |
|
8 |
def fetch_stock_data(company_name):
|
9 |
# Fetch stock data using Yahoo Finance
|
@@ -25,11 +25,6 @@ def fetch_stock_data(company_name):
|
|
25 |
|
26 |
return stock_data
|
27 |
|
28 |
-
def respond_to_query(query):
|
29 |
-
# Use the LLM to process the query and fetch relevant data
|
30 |
-
response = llm.invoke(query)
|
31 |
-
return response
|
32 |
-
|
33 |
def main(company_name):
|
34 |
# Fetch stock data and generate a response
|
35 |
stock_data = fetch_stock_data(company_name)
|
|
|
2 |
from langchain_groq import ChatGroq
|
3 |
import yfinance as yf
|
4 |
|
5 |
+
# Initialize the ChatGroq model using Hugging Face's secret management
|
6 |
+
llm = ChatGroq(model_name="Llama3-8b-8192", api_key="groq_api_key")
|
7 |
|
8 |
def fetch_stock_data(company_name):
|
9 |
# Fetch stock data using Yahoo Finance
|
|
|
25 |
|
26 |
return stock_data
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
def main(company_name):
|
29 |
# Fetch stock data and generate a response
|
30 |
stock_data = fetch_stock_data(company_name)
|