Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,24 +1,4 @@
|
|
1 |
# Import the necessary libraries
|
2 |
-
import gradio as gr
|
3 |
-
import os
|
4 |
-
import uuid
|
5 |
-
import json
|
6 |
-
import pandas as pd
|
7 |
-
import subprocess
|
8 |
-
from openai import OpenAI
|
9 |
-
from huggingface_hub import HfApi
|
10 |
-
from huggingface_hub import CommitScheduler
|
11 |
-
from langchain_community.embeddings.sentence_transformer import (
|
12 |
-
SentenceTransformerEmbeddings
|
13 |
-
)
|
14 |
-
from langchain_community.vectorstores import Chroma
|
15 |
-
from google.colab import userdata, drive
|
16 |
-
from pathlib import Path
|
17 |
-
from langchain.document_loaders import PyPDFDirectoryLoader
|
18 |
-
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
19 |
-
import json
|
20 |
-
import tiktoken
|
21 |
-
import pandas as pd
|
22 |
import subprocess
|
23 |
import sys
|
24 |
|
@@ -39,12 +19,27 @@ try:
|
|
39 |
except subprocess.CalledProcessError as e:
|
40 |
print(f"An error occurred: {e}")
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
# Define the embedding model and the vectorstore
|
50 |
embedding_model = SentenceTransformerEmbeddings(model_name='thenlper/gte-large')
|
|
|
1 |
# Import the necessary libraries
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import subprocess
|
3 |
import sys
|
4 |
|
|
|
19 |
except subprocess.CalledProcessError as e:
|
20 |
print(f"An error occurred: {e}")
|
21 |
|
22 |
+
import gradio as gr
|
23 |
+
import os
|
24 |
+
import uuid
|
25 |
+
import json
|
26 |
+
import pandas as pd
|
27 |
+
import subprocess
|
28 |
+
from openai import OpenAI
|
29 |
+
from huggingface_hub import HfApi
|
30 |
+
from huggingface_hub import CommitScheduler
|
31 |
+
from langchain_community.embeddings.sentence_transformer import (
|
32 |
+
SentenceTransformerEmbeddings
|
33 |
+
)
|
34 |
+
from langchain_community.vectorstores import Chroma
|
35 |
+
from google.colab import userdata, drive
|
36 |
+
from pathlib import Path
|
37 |
+
from langchain.document_loaders import PyPDFDirectoryLoader
|
38 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
39 |
+
import json
|
40 |
+
import tiktoken
|
41 |
+
import pandas as pd
|
42 |
+
import tiktoken
|
43 |
|
44 |
# Define the embedding model and the vectorstore
|
45 |
embedding_model = SentenceTransformerEmbeddings(model_name='thenlper/gte-large')
|