Spaces:
Runtime error
Runtime error
Commit
·
6e05406
1
Parent(s):
59b8695
Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def chatbot(input_text, input_voice, patient_name=None):
|
|
140 |
# Get a response from GPT-3.5-turbo
|
141 |
gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, gpt_general = get_gpt_response(input_text)
|
142 |
# Save GPT response to a file
|
143 |
-
gpt_file_path = os.path.join('GPTresponses', f"{patient_name}.txt")
|
144 |
with open(gpt_file_path, "a") as f:
|
145 |
f.write(f"Subjective: {gpt_subjective}\nObjective: {gpt_objective}\nAssessment: {gpt_assessment}\nPlan: {gpt_plan}\nGeneral: {gpt_general}\n\n")
|
146 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
@@ -149,7 +149,7 @@ def chatbot(input_text, input_voice, patient_name=None):
|
|
149 |
soap_response = response_index.response
|
150 |
|
151 |
patient_name = soap_response.split(' ')[1] if 'Subjective:' in soap_response else 'General'
|
152 |
-
patient_file_path = os.path.join('Docs', f"{patient_name}.txt")
|
153 |
|
154 |
if all(keyword.lower() in soap_response.lower() for keyword in ["subjective:", "objective:", "assessment:", "plan:"]):
|
155 |
s_index = soap_response.lower().find('subjective:')
|
@@ -196,7 +196,7 @@ interface = Interface(
|
|
196 |
)
|
197 |
|
198 |
|
199 |
-
index = construct_index('Docs')
|
200 |
interface.launch()
|
201 |
|
202 |
|
|
|
140 |
# Get a response from GPT-3.5-turbo
|
141 |
gpt_subjective, gpt_objective, gpt_assessment, gpt_plan, gpt_general = get_gpt_response(input_text)
|
142 |
# Save GPT response to a file
|
143 |
+
gpt_file_path = os.path.join('GPTresponses/', f"{patient_name}.txt")
|
144 |
with open(gpt_file_path, "a") as f:
|
145 |
f.write(f"Subjective: {gpt_subjective}\nObjective: {gpt_objective}\nAssessment: {gpt_assessment}\nPlan: {gpt_plan}\nGeneral: {gpt_general}\n\n")
|
146 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
|
|
149 |
soap_response = response_index.response
|
150 |
|
151 |
patient_name = soap_response.split(' ')[1] if 'Subjective:' in soap_response else 'General'
|
152 |
+
patient_file_path = os.path.join('Docs/', f"{patient_name}.txt")
|
153 |
|
154 |
if all(keyword.lower() in soap_response.lower() for keyword in ["subjective:", "objective:", "assessment:", "plan:"]):
|
155 |
s_index = soap_response.lower().find('subjective:')
|
|
|
196 |
)
|
197 |
|
198 |
|
199 |
+
index = construct_index('Docs/')
|
200 |
interface.launch()
|
201 |
|
202 |
|