Shreyas094
commited on
Commit
•
e81c09c
1
Parent(s):
47bf3b8
Update app.py
Browse files
app.py
CHANGED
@@ -150,10 +150,12 @@ After writing the response, please provide a list of sources used (document name
|
|
150 |
|
151 |
generated_text = generate_chunked_response(prompt)
|
152 |
|
|
|
153 |
content_start = generated_text.find("[/INST]")
|
154 |
if content_start != -1:
|
155 |
generated_text = generated_text[content_start + 7:].strip()
|
156 |
|
|
|
157 |
parts = generated_text.split("Sources:", 1)
|
158 |
main_content = parts[0].strip()
|
159 |
sources = parts[1].strip() if len(parts) > 1 else ""
|
|
|
150 |
|
151 |
generated_text = generate_chunked_response(prompt)
|
152 |
|
153 |
+
# Remove the instruction part from the response
|
154 |
content_start = generated_text.find("[/INST]")
|
155 |
if content_start != -1:
|
156 |
generated_text = generated_text[content_start + 7:].strip()
|
157 |
|
158 |
+
# Split the content and sources
|
159 |
parts = generated_text.split("Sources:", 1)
|
160 |
main_content = parts[0].strip()
|
161 |
sources = parts[1].strip() if len(parts) > 1 else ""
|