Skip to content

Commit e2c3653

Browse files
author
Sicheng Pan
committed
Fix collection model
1 parent 18a3ba9 commit e2c3653

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: chromadb/api/models/AsyncCollection.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,18 @@ async def fork(
269269
Returns:
270270
Collection: A new collection with the specified name and containing identical data to the current collection.
271271
"""
272-
return await self._client._fork(
272+
model = await self._client._fork(
273273
collection_id=self.id,
274274
new_name=new_name,
275275
tenant=self.tenant,
276276
database=self.database,
277277
)
278+
return AsyncCollection(
279+
client=self._client,
280+
model=model,
281+
embedding_function=self._embedding_function,
282+
data_loader=self._data_loader
283+
)
278284

279285
async def update(
280286
self,

Diff for: chromadb/api/models/Collection.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,18 @@ def fork(
275275
Returns:
276276
Collection: A new collection with the specified name and containing identical data to the current collection.
277277
"""
278-
return self._client._fork(
278+
model = self._client._fork(
279279
collection_id=self.id,
280280
new_name=new_name,
281281
tenant=self.tenant,
282282
database=self.database,
283283
)
284+
return Collection(
285+
client=self._client,
286+
model=model,
287+
embedding_function=self._embedding_function,
288+
data_loader=self._data_loader
289+
)
284290

285291
def update(
286292
self,

0 commit comments

Comments
 (0)