Spaces:
Runtime error
Runtime error
Commit ·
902ab6f
1
Parent(s): 36eb864
Upload app.py
Browse files
app.py
CHANGED
|
@@ -6,19 +6,15 @@ from langchain.llms import OpenAI
|
|
| 6 |
import os
|
| 7 |
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
with open("guide1.txt") as f:
|
| 12 |
hitchhikersguide = f.read()
|
| 13 |
|
| 14 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0, separator = "\n")
|
| 15 |
texts = text_splitter.split_text(hitchhikersguide)
|
| 16 |
|
| 17 |
-
openai.api_key = "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"
|
| 18 |
-
os.environ["OPENAI_API_KEY"] = openai.api_key
|
| 19 |
|
| 20 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 21 |
-
os.environ["OPENAI_API_KEY"] = openai.api_key
|
| 22 |
embeddings = OpenAIEmbeddings()
|
| 23 |
embeddings = OpenAIEmbeddings()
|
| 24 |
|
|
|
|
| 6 |
import os
|
| 7 |
|
| 8 |
|
|
|
|
|
|
|
| 9 |
with open("guide1.txt") as f:
|
| 10 |
hitchhikersguide = f.read()
|
| 11 |
|
| 12 |
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0, separator = "\n")
|
| 13 |
texts = text_splitter.split_text(hitchhikersguide)
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
| 17 |
+
#os.environ["OPENAI_API_KEY"] = openai.api_key
|
| 18 |
embeddings = OpenAIEmbeddings()
|
| 19 |
embeddings = OpenAIEmbeddings()
|
| 20 |
|