Pavithiran
commited on
Commit
•
6ad40b4
1
Parent(s):
54c0720
Update model.py
Browse files
model.py
CHANGED
@@ -7,13 +7,9 @@ class Model:
|
|
7 |
self.embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
8 |
|
9 |
def __call__(self, payload):
|
10 |
-
# Extract
|
11 |
-
|
12 |
-
source_sentence = inputs.get("source_sentence", "")
|
13 |
-
sentences = inputs.get("sentences", [])
|
14 |
|
15 |
-
# Combine source_sentence with sentences
|
16 |
-
chunks = [source_sentence] + sentences
|
17 |
# Generate embeddings
|
18 |
embeddings = self.embedding_model.encode(chunks, convert_to_tensor=True)
|
19 |
|
|
|
7 |
self.embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
8 |
|
9 |
def __call__(self, payload):
|
10 |
+
# Extract text chunks from the payload
|
11 |
+
chunks = payload.get("inputs", [])
|
|
|
|
|
12 |
|
|
|
|
|
13 |
# Generate embeddings
|
14 |
embeddings = self.embedding_model.encode(chunks, convert_to_tensor=True)
|
15 |
|