Spaces:
Runtime error
Runtime error
add api_key variable
Browse files
app.py
CHANGED
|
@@ -50,7 +50,8 @@ class RetrievalAugmentedQAPipeline:
|
|
| 50 |
return {"response": generate_response(), "context": context_list}
|
| 51 |
|
| 52 |
# text_splitter = RecursiveCharacterTextSplitter()
|
| 53 |
-
|
|
|
|
| 54 |
|
| 55 |
def process_text_file(file: AskFileResponse):
|
| 56 |
import tempfile
|
|
|
|
| 50 |
return {"response": generate_response(), "context": context_list}
|
| 51 |
|
| 52 |
# text_splitter = RecursiveCharacterTextSplitter()
|
| 53 |
+
api_key = os.getenv("OPENAI_API_KEY")
|
| 54 |
+
text_splitter = SemanticChunker(OpenAIEmbeddings(api_key=api_key), breakpoint_threshold_type="standard_deviation")
|
| 55 |
|
| 56 |
def process_text_file(file: AskFileResponse):
|
| 57 |
import tempfile
|