Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -428,27 +428,6 @@ def initialize():
|
|
| 428 |
print("HELLLLLLLLLO:", os.getcwd()) # Check the current working directory
|
| 429 |
print("BYYYYYYYYYYYYE:", os.listdir()) # List files and folders in the current
|
| 430 |
llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
# Path to the vectorstore directory inside /home/user/app
|
| 435 |
-
vectorstore_path = os.path.join(os.getcwd(), "vectorstore")
|
| 436 |
-
print(f"Vectorstore Path: {vectorstore_path}")
|
| 437 |
-
|
| 438 |
-
# Ensure the directory exists
|
| 439 |
-
os.makedirs(vectorstore_path, exist_ok=True)
|
| 440 |
-
print("Subdirectories:", [d for d in os.listdir(os.getcwd()) if os.path.isdir(os.path.join(os.getcwd(), d))])
|
| 441 |
-
vectorstore = get_chroma_vectorstore2(EMBEDDING_MODEL_NAME)
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
current_directory = os.getcwd()
|
| 445 |
-
|
| 446 |
-
# Construct the path to the 'data' folder
|
| 447 |
-
data_path = os.path.join(current_directory, 'data')
|
| 448 |
-
print(data_path)
|
| 449 |
-
texts = ["Text 1", "Text 2", "Text 3"]
|
| 450 |
-
|
| 451 |
-
vectorstore = Chroma.from_texts(texts, embedding_function=EMBEDDING_MODEL_NAME, persist_directory = data_path)
|
| 452 |
|
| 453 |
initialize()
|
| 454 |
|
|
|
|
| 428 |
print("HELLLLLLLLLO:", os.getcwd()) # Check the current working directory
|
| 429 |
print("BYYYYYYYYYYYYE:", os.listdir()) # List files and folders in the current
|
| 430 |
llm = setup_llm(LLM_MODEL_NAME, LLM_TEMPERATURE, GROQ_API_KEY)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 431 |
|
| 432 |
initialize()
|
| 433 |
|