Abby Reynolds commited on
Commit
0adf235
·
1 Parent(s): 41ab2f9

Fix Chroma type hint for Spaces runtime

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- from typing import List, Tuple
3
 
4
  import chromadb
5
  from chromadb.config import Settings
@@ -47,7 +47,7 @@ def build_chunks(articles: List[str]) -> Tuple[List[str], List[str]]:
47
  return ids, texts
48
 
49
 
50
- def ensure_collection() -> Tuple[chromadb.api.types.Collection, SentenceTransformer]:
51
  """Get or build the Chroma collection, persisting to disk."""
52
  client = chromadb.PersistentClient(path=CHROMA_DIR, settings=Settings(anonymized_telemetry=False))
53
  collection = client.get_or_create_collection(name=COLLECTION_NAME)
 
1
  import os
2
+ from typing import Any, List, Tuple
3
 
4
  import chromadb
5
  from chromadb.config import Settings
 
47
  return ids, texts
48
 
49
 
50
+ def ensure_collection() -> Tuple[Any, SentenceTransformer]:
51
  """Get or build the Chroma collection, persisting to disk."""
52
  client = chromadb.PersistentClient(path=CHROMA_DIR, settings=Settings(anonymized_telemetry=False))
53
  collection = client.get_or_create_collection(name=COLLECTION_NAME)