Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,6 +65,12 @@ text = ' '.join(text)
|
|
65 |
|
66 |
chunks = [text[i:i + chunk_size] for i in range(0, len(text), chunk_size)]
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
text_embeddings = np.array([get_text_embedding(chunk) for chunk in chunks])
|
69 |
|
70 |
d = text_embeddings.shape[1]
|
@@ -73,13 +79,6 @@ index.add(text_embeddings)
|
|
73 |
|
74 |
print("Finish the model init process")
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
def get_text_embedding(text):
|
80 |
-
|
81 |
-
return embeddings.embed_query(text)
|
82 |
-
|
83 |
def qa(question: str, doc: str) -> str:
|
84 |
|
85 |
|
|
|
65 |
|
66 |
chunks = [text[i:i + chunk_size] for i in range(0, len(text), chunk_size)]
|
67 |
|
68 |
+
|
69 |
+
def get_text_embedding(text):
|
70 |
+
|
71 |
+
return embeddings.embed_query(text)
|
72 |
+
|
73 |
+
|
74 |
text_embeddings = np.array([get_text_embedding(chunk) for chunk in chunks])
|
75 |
|
76 |
d = text_embeddings.shape[1]
|
|
|
79 |
|
80 |
print("Finish the model init process")
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
def qa(question: str, doc: str) -> str:
|
83 |
|
84 |
|