Spaces:
Runtime error
Runtime error
pandas fix
Browse files- mental_health_raqa.py +5 -2
- requirements.txt +2 -1
mental_health_raqa.py
CHANGED
|
@@ -11,10 +11,11 @@ from langchain.callbacks import StdOutCallbackHandler
|
|
| 11 |
|
| 12 |
def create_index():
|
| 13 |
# load the data
|
| 14 |
-
|
|
|
|
| 15 |
loader = CSVLoader(file_path = df_path)
|
| 16 |
data = loader.load()
|
| 17 |
-
|
| 18 |
# create the embeddings model
|
| 19 |
embeddings_model = OpenAIEmbeddings()
|
| 20 |
|
|
@@ -51,3 +52,5 @@ def mh_assistant(openai_key,query):
|
|
| 51 |
|
| 52 |
# Ask a question
|
| 53 |
return qa_with_sources_chain({"query":query})
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def create_index():
|
| 13 |
# load the data
|
| 14 |
+
dir = os.path.dirname(__file__)
|
| 15 |
+
df_path = dir + '/data/Mental_Health_FAQ.csv'
|
| 16 |
loader = CSVLoader(file_path = df_path)
|
| 17 |
data = loader.load()
|
| 18 |
+
|
| 19 |
# create the embeddings model
|
| 20 |
embeddings_model = OpenAIEmbeddings()
|
| 21 |
|
|
|
|
| 52 |
|
| 53 |
# Ask a question
|
| 54 |
return qa_with_sources_chain({"query":query})
|
| 55 |
+
|
| 56 |
+
# print(mh_assistant("sadfs",'what is mental health?'))
|
requirements.txt
CHANGED
|
@@ -3,4 +3,5 @@ langchain
|
|
| 3 |
langchain-text-splitters
|
| 4 |
faiss-cpu
|
| 5 |
tiktoken
|
| 6 |
-
langchain_openai
|
|
|
|
|
|
| 3 |
langchain-text-splitters
|
| 4 |
faiss-cpu
|
| 5 |
tiktoken
|
| 6 |
+
langchain_openai
|
| 7 |
+
pandas
|