Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,22 @@
|
|
| 1 |
import os
|
| 2 |
import nltk
|
| 3 |
-
import requests
|
| 4 |
-
import chainlit as cl
|
| 5 |
-
from llama_index import VectorStoreIndex, Document, ServiceContext
|
| 6 |
-
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
| 7 |
-
from llama_index.llms.groq import Groq
|
| 8 |
-
from llama_index.node_parser import SentenceSplitter
|
| 9 |
-
from dotenv import load_dotenv
|
| 10 |
|
| 11 |
-
#
|
| 12 |
nltk_data_dir = os.path.expanduser("~/.nltk_data")
|
| 13 |
os.makedirs(nltk_data_dir, exist_ok=True)
|
| 14 |
nltk.data.path.append(nltk_data_dir)
|
|
|
|
|
|
|
| 15 |
nltk.download('punkt', download_dir=nltk_data_dir, quiet=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
load_dotenv()
|
| 18 |
|
|
|
|
| 1 |
import os
|
| 2 |
import nltk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
# Use a directory within the user's home directory
|
| 5 |
nltk_data_dir = os.path.expanduser("~/.nltk_data")
|
| 6 |
os.makedirs(nltk_data_dir, exist_ok=True)
|
| 7 |
nltk.data.path.append(nltk_data_dir)
|
| 8 |
+
|
| 9 |
+
# Download NLTK data
|
| 10 |
nltk.download('punkt', download_dir=nltk_data_dir, quiet=True)
|
| 11 |
+
import chainlit as cl
|
| 12 |
+
from llama_index.core import VectorStoreIndex, Document
|
| 13 |
+
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
| 14 |
+
from llama_index.llms.groq import Groq
|
| 15 |
+
from llama_index.core import ServiceContext
|
| 16 |
+
from llama_index.core.node_parser import SentenceSplitter
|
| 17 |
+
from dotenv import load_dotenv
|
| 18 |
+
import yfinance as yf
|
| 19 |
+
import pandas as pd
|
| 20 |
|
| 21 |
load_dotenv()
|
| 22 |
|