Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,22 @@ if not all([NEWSAPI_KEY, APCA_API_KEY_ID, APCA_API_SECRET_KEY]):
|
|
28 |
|
29 |
# Initialize NewsAPI client
|
30 |
newsapi = NewsApiClient(api_key=NEWSAPI_KEY)
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# Initialize Alpaca Trade API client
|
33 |
alpaca_api = tradeapi.REST(APCA_API_KEY_ID, APCA_API_SECRET_KEY, base_url='https://paper-api.alpaca.markets')
|
34 |
|
|
|
28 |
|
29 |
# Initialize NewsAPI client
|
30 |
newsapi = NewsApiClient(api_key=NEWSAPI_KEY)
|
31 |
+
# Initialize the chatbot
|
32 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
33 |
+
llm = HuggingFaceEndpoint(
|
34 |
+
#repo_id="google/gemma-2b-it",
|
35 |
+
#repo_id="abhinand/gemma-2b-tamil",
|
36 |
+
repo_id="mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis",
|
37 |
+
#repo_id="google/gemma-2b",
|
38 |
+
|
39 |
+
task="financial-analysis",
|
40 |
+
max_new_tokens=512,
|
41 |
+
top_k=5,
|
42 |
+
temperature=0.2,
|
43 |
+
repetition_penalty=1.03,
|
44 |
+
timeout=300,
|
45 |
+
huggingfacehub_api_token=HF_TOKEN
|
46 |
+
)
|
47 |
# Initialize Alpaca Trade API client
|
48 |
alpaca_api = tradeapi.REST(APCA_API_KEY_ID, APCA_API_SECRET_KEY, base_url='https://paper-api.alpaca.markets')
|
49 |
|