Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,9 +46,13 @@ class GEOSEOApp:
|
|
| 46 |
temperature=0.1
|
| 47 |
)
|
| 48 |
|
|
|
|
| 49 |
self.embeddings = HuggingFaceEmbeddings(
|
| 50 |
model_name="sentence-transformers/all-MiniLM-L6-v2",
|
| 51 |
cache_folder="./hf_cache",
|
|
|
|
|
|
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
def setup_parsers(self):
|
|
|
|
| 46 |
temperature=0.1
|
| 47 |
)
|
| 48 |
|
| 49 |
+
# Updated embeddings initialization with proper device handling
|
| 50 |
self.embeddings = HuggingFaceEmbeddings(
|
| 51 |
model_name="sentence-transformers/all-MiniLM-L6-v2",
|
| 52 |
cache_folder="./hf_cache",
|
| 53 |
+
device="cpu", # Force CPU usage
|
| 54 |
+
encode_kwargs={'normalize_embeddings': True}, # Add encoding parameters
|
| 55 |
+
model_kwargs={'device': 'cpu'} # Ensure model loads on CPU
|
| 56 |
)
|
| 57 |
|
| 58 |
def setup_parsers(self):
|