Spaces:
Runtime error
Runtime error
Commit
·
08c3db3
1
Parent(s):
ed111bd
remove secret variable
Browse files
app.py
CHANGED
@@ -12,30 +12,10 @@ from pinecone.core.client.configuration import Configuration as OpenApiConfigura
|
|
12 |
import gradio as gr
|
13 |
import time
|
14 |
|
15 |
-
# socks.set_default_proxy(socks.SOCKS5, "http://u477827:[email protected]", 80)
|
16 |
-
# socket.socket = socks.socksocket
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
# with open('2.txt') as f:
|
21 |
-
# state_of_the_union = f.read()
|
22 |
-
# text_splitter = CharacterTextSplitter(chunk_size=500, chunk_overlap=50)
|
23 |
-
# texts = text_splitter.create_documents([state_of_the_union])
|
24 |
-
# print(texts[0])
|
25 |
-
# print(texts[1])
|
26 |
-
|
27 |
os.environ["OPENAI_API_TYPE"] = "azure"
|
28 |
-
os.environ["OPENAI_API_KEY"] = "f930f70cf65f48a8a750a22c813ba1b3"
|
29 |
-
os.environ["OPENAI_API_BASE"] = "https://stla-baby.openai.azure.com/"
|
30 |
os.environ["OPENAI_API_VERSION"] = "2023-05-15"
|
31 |
-
# os.environ["OPENAI_PROXY"] = 'http://u477827:[email protected]:80'
|
32 |
-
|
33 |
-
# openai.api_type = "azure"
|
34 |
-
# openai.api_key = "f930f70cf65f48a8a750a22c813ba1b3"
|
35 |
-
# openai.api_base = "https://stla-baby.openai.azure.com/"
|
36 |
-
# openai.api_version = "2023-05-15" # subject to change
|
37 |
-
# # openai.proxy = 'http://u477827:[email protected]:80'
|
38 |
-
# openai.proxy = 'http://u477827:[email protected]:8080'
|
39 |
|
40 |
|
41 |
chat = AzureChatOpenAI(
|
@@ -45,14 +25,10 @@ chat = AzureChatOpenAI(
|
|
45 |
|
46 |
embeddings = OpenAIEmbeddings(deployment="model_embedding")
|
47 |
|
48 |
-
|
49 |
-
openapi_config = OpenApiConfiguration.get_default_copy()
|
50 |
-
# openapi_config.verify_ssl = True
|
51 |
-
openapi_config.proxy = "http://u477827:[email protected]:80"
|
52 |
-
# openapi_config.proxy = "http://u477827:[email protected]:8080"
|
53 |
|
54 |
pinecone.init(
|
55 |
-
api_key=
|
56 |
environment='asia-southeast1-gcp-free',
|
57 |
# openapi_config=openapi_config
|
58 |
)
|
|
|
12 |
import gradio as gr
|
13 |
import time
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
os.environ["OPENAI_API_TYPE"] = "azure"
|
16 |
+
# os.environ["OPENAI_API_KEY"] = "f930f70cf65f48a8a750a22c813ba1b3"
|
17 |
+
# os.environ["OPENAI_API_BASE"] = "https://stla-baby.openai.azure.com/"
|
18 |
os.environ["OPENAI_API_VERSION"] = "2023-05-15"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
chat = AzureChatOpenAI(
|
|
|
25 |
|
26 |
embeddings = OpenAIEmbeddings(deployment="model_embedding")
|
27 |
|
28 |
+
# pinecone_api_key='0def3ea0-93cd-4ead-b0c6-2ab44b3ede21'
|
|
|
|
|
|
|
|
|
29 |
|
30 |
pinecone.init(
|
31 |
+
api_key = pinecone_api_key,
|
32 |
environment='asia-southeast1-gcp-free',
|
33 |
# openapi_config=openapi_config
|
34 |
)
|