Spaces:
Runtime error
Runtime error
update readme
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: π
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
|
|
1 |
---
|
2 |
+
title: MidtermTask2
|
3 |
emoji: π
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
app.py
CHANGED
@@ -13,7 +13,6 @@ from aimakerspace.openai_utils.chatmodel import ChatOpenAI
|
|
13 |
from langchain_experimental.text_splitter import SemanticChunker
|
14 |
from langchain_openai.embeddings import OpenAIEmbeddings
|
15 |
import chainlit as cl
|
16 |
-
import tempfile
|
17 |
from langchain_community.document_loaders.pdf import PyPDFLoader
|
18 |
|
19 |
system_template = """\
|
@@ -55,7 +54,7 @@ class RetrievalAugmentedQAPipeline:
|
|
55 |
text_splitter = SemanticChunker(OpenAIEmbeddings(), breakpoint_threshold_type="standard_deviation")
|
56 |
|
57 |
def process_text_file(file: AskFileResponse):
|
58 |
-
|
59 |
|
60 |
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=file.name) as temp_file:
|
61 |
temp_file_path = temp_file.name
|
|
|
13 |
from langchain_experimental.text_splitter import SemanticChunker
|
14 |
from langchain_openai.embeddings import OpenAIEmbeddings
|
15 |
import chainlit as cl
|
|
|
16 |
from langchain_community.document_loaders.pdf import PyPDFLoader
|
17 |
|
18 |
system_template = """\
|
|
|
54 |
text_splitter = SemanticChunker(OpenAIEmbeddings(), breakpoint_threshold_type="standard_deviation")
|
55 |
|
56 |
def process_text_file(file: AskFileResponse):
|
57 |
+
import tempfile
|
58 |
|
59 |
with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=file.name) as temp_file:
|
60 |
temp_file_path = temp_file.name
|