Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,9 +36,8 @@ def chunk_text(text, max_length=500):
|
|
| 36 |
chunks.append(chunk.strip())
|
| 37 |
return chunks
|
| 38 |
|
| 39 |
-
# Function to compute embeddings
|
| 40 |
def compute_embeddings(chunks):
|
| 41 |
-
# Create simple embeddings based on the ASCII sum of characters in each chunk
|
| 42 |
embeddings = []
|
| 43 |
for chunk in chunks:
|
| 44 |
vector = np.array([ord(char) for char in chunk[:300]]) # Truncate to 300 characters
|
|
|
|
| 36 |
chunks.append(chunk.strip())
|
| 37 |
return chunks
|
| 38 |
|
| 39 |
+
# Function to compute simple embeddings
|
| 40 |
def compute_embeddings(chunks):
|
|
|
|
| 41 |
embeddings = []
|
| 42 |
for chunk in chunks:
|
| 43 |
vector = np.array([ord(char) for char in chunk[:300]]) # Truncate to 300 characters
|