Spaces:
Runtime error
Runtime error
Mehdi BESSAA
commited on
Commit
·
794fcfd
1
Parent(s):
c03941e
feat: brotli compression on parquer file, add auth passwd
Browse files- app.py +3 -8
- email_200.parquet +2 -2
app.py
CHANGED
|
@@ -11,20 +11,15 @@ from openai.embeddings_utils import get_embedding, cosine_similarity
|
|
| 11 |
|
| 12 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 13 |
|
|
|
|
|
|
|
| 14 |
title = "Confidential forensics tool with ChatGPT"
|
| 15 |
examples = ["Who is Phillip Allen?", "What the project in Austin is about?", "Give me more details about the real estate project"]
|
| 16 |
|
| 17 |
index = GPTSimpleVectorIndex.load_from_disk('email.json')
|
| 18 |
|
| 19 |
dat_fr = pd.DataFrame({"Documents loaded": ["email.json", "email_200.parquet"]})
|
| 20 |
-
|
| 21 |
df = pd.read_parquet("email_200.parquet")
|
| 22 |
-
# df["embedding"] = [get_embedding(x) forW x in df.body.values]
|
| 23 |
-
# df.to_parquet("email_50.parquet")
|
| 24 |
-
|
| 25 |
-
# df = pd.read_csv("email_ok.csv", nrows=50)
|
| 26 |
-
# df["embedding"] = [get_embedding(x) for x in df.body.values]
|
| 27 |
-
# df.to_parquet("email_50.parquet")
|
| 28 |
|
| 29 |
def search_emails(opt, message, n=3):
|
| 30 |
"Outputs the top n emails that match the most the pattern"
|
|
@@ -137,4 +132,4 @@ with gr.Blocks(title=title) as demo:
|
|
| 137 |
btn_send2.click(search_emails, [opt, msg2], [opt, msg2])
|
| 138 |
|
| 139 |
if __name__ == "__main__":
|
| 140 |
-
demo.launch()
|
|
|
|
| 11 |
|
| 12 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 13 |
|
| 14 |
+
passwd = os.getenv("PASSWD_SECRET")
|
| 15 |
+
|
| 16 |
title = "Confidential forensics tool with ChatGPT"
|
| 17 |
examples = ["Who is Phillip Allen?", "What the project in Austin is about?", "Give me more details about the real estate project"]
|
| 18 |
|
| 19 |
index = GPTSimpleVectorIndex.load_from_disk('email.json')
|
| 20 |
|
| 21 |
dat_fr = pd.DataFrame({"Documents loaded": ["email.json", "email_200.parquet"]})
|
|
|
|
| 22 |
df = pd.read_parquet("email_200.parquet")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
def search_emails(opt, message, n=3):
|
| 25 |
"Outputs the top n emails that match the most the pattern"
|
|
|
|
| 132 |
btn_send2.click(search_emails, [opt, msg2], [opt, msg2])
|
| 133 |
|
| 134 |
if __name__ == "__main__":
|
| 135 |
+
demo.launch(auth=("mithril", passwd))
|
email_200.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:059c095bad18d8c299ab701ca19ac1d938e82bba28af7d6e9a333bd20a35586a
|
| 3 |
+
size 3098469
|