Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -36,12 +36,6 @@ logging.basicConfig(level=logging.INFO, format='%(message)s')
|
|
36 |
display_ticker=[]
|
37 |
part = "day"
|
38 |
|
39 |
-
today = datetime.now()
|
40 |
-
logging.info("Todays date: %s", today)
|
41 |
-
plus_one_day = today + timedelta(days=1)
|
42 |
-
todays = today.strftime('%B %d')
|
43 |
-
tomorrow = plus_one_day.strftime('%B %d')
|
44 |
-
|
45 |
client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
|
46 |
# client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
|
47 |
# client = InferenceClient("google/gemma-2-2b-it")
|
@@ -161,6 +155,7 @@ async def get_moneycontrol_news():
|
|
161 |
print(f"Article Scraped Successfully from {link}")
|
162 |
|
163 |
print("Creating context file...")
|
|
|
164 |
formatted_date = today.strftime('%d%B%Y')
|
165 |
filename = f"templates/{formatted_date}" + '.txt'
|
166 |
with open(filename, 'w') as file:
|
@@ -376,7 +371,12 @@ async def get_the_ticker_news(stock):
|
|
376 |
return [], ""
|
377 |
|
378 |
async def trade_setup():
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
380 |
market_data= []
|
381 |
results = DDGS().text(f'intitle:Trade Setup {tomorrow} site:cnbctv18.com', max_results=1, timelimit='w')
|
382 |
todays_url = "https://www.cnbctv18.com/market-live/"
|
@@ -571,7 +571,14 @@ def insert_in_db(query, ticker_financials, context_files, ticker_stats, reports,
|
|
571 |
return None
|
572 |
|
573 |
def generate_final_response(prompt, history):
|
574 |
-
global display_ticker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
|
576 |
context_files=[]
|
577 |
ticker_stats=[]
|
|
|
36 |
display_ticker=[]
|
37 |
part = "day"
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
|
40 |
# client = InferenceClient("meta-llama/Meta-Llama-3-8B-Instruct")
|
41 |
# client = InferenceClient("google/gemma-2-2b-it")
|
|
|
155 |
print(f"Article Scraped Successfully from {link}")
|
156 |
|
157 |
print("Creating context file...")
|
158 |
+
today = datetime.now()
|
159 |
formatted_date = today.strftime('%d%B%Y')
|
160 |
filename = f"templates/{formatted_date}" + '.txt'
|
161 |
with open(filename, 'w') as file:
|
|
|
371 |
return [], ""
|
372 |
|
373 |
async def trade_setup():
|
374 |
+
|
375 |
+
today = datetime.now()
|
376 |
+
plus_one_day = today + timedelta(days=1)
|
377 |
+
todays = today.strftime('%B %d')
|
378 |
+
tomorrow = plus_one_day.strftime('%B %d')
|
379 |
+
|
380 |
market_data= []
|
381 |
results = DDGS().text(f'intitle:Trade Setup {tomorrow} site:cnbctv18.com', max_results=1, timelimit='w')
|
382 |
todays_url = "https://www.cnbctv18.com/market-live/"
|
|
|
571 |
return None
|
572 |
|
573 |
def generate_final_response(prompt, history):
|
574 |
+
global display_ticker
|
575 |
+
|
576 |
+
# logging the dates
|
577 |
+
today = datetime.now()
|
578 |
+
logging.info("Todays date: %s", today)
|
579 |
+
plus_one_day = today + timedelta(days=1)
|
580 |
+
todays = today.strftime('%B %d')
|
581 |
+
tomorrow = plus_one_day.strftime('%B %d')
|
582 |
|
583 |
context_files=[]
|
584 |
ticker_stats=[]
|