ai-parrot 0.3.6__cp311-cp311-manylinux_2_28_x86_64.whl → 0.3.8__cp311-cp311-manylinux_2_28_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ai-parrot might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ai-parrot
3
- Version: 0.3.6
3
+ Version: 0.3.8
4
4
  Summary: Live Chatbots based on Langchain chatbots and Agents Integrated into Navigator Framework or used into aiohttp applications.
5
5
  Home-page: https://github.com/phenobarbital/ai-parrot
6
6
  Author: Jesus Lara
@@ -4,7 +4,7 @@ parrot/exceptions.cpython-311-x86_64-linux-gnu.so,sha256=VNyBh3uLxGQgB0l1bkWjQDq
4
4
  parrot/manager.py,sha256=NhzXoWxSgtoWHpmYP8cV2Ujq_SlvCbQYQBaohAeL2TM,5935
5
5
  parrot/models.py,sha256=RsVQCqhSXBKRPcu-BCga9Y1wyvENFXDCuq3_ObIKvAo,13452
6
6
  parrot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- parrot/version.py,sha256=x5KFeKUhuf0IyJRSN3fSKlwqSDRNfHYDoFae9slFeKc,373
7
+ parrot/version.py,sha256=GrRYsZgC8VWhmiAeLkx1nVkvl0dOVtxfv04pU-T01pg,373
8
8
  parrot/chatbots/__init__.py,sha256=ypskCnME0xUv6psBEGCEyXCrD0J0ULHSllpVmSxqb4A,200
9
9
  parrot/chatbots/abstract.py,sha256=CmDn3k4r9uKImOZRN4L9zxLbCdC-1MPUAorDlfZT-kA,26421
10
10
  parrot/chatbots/asktroc.py,sha256=gyWzyvpAnmXwXd-3DEKoIJtAxt6NnP5mUZdZbkFky8s,604
@@ -68,7 +68,7 @@ parrot/loaders/repo.py,sha256=vBqBAnwU6p3_DCvI9DVhi1Bs8iCDYHwFGp0P9zvGRyw,3737
68
68
  parrot/loaders/rtd.py,sha256=oKOC9Qn3iwulYx5BEvXy4_kusKRsy5RLYNHS-e5p-1k,1988
69
69
  parrot/loaders/txt.py,sha256=AeGroWffFT--7TYlTSTr5Av5zAr8YIp1fxt8r5qdi-A,2802
70
70
  parrot/loaders/video.py,sha256=pl5Ho69bp5vrWMqg5tLbsnHUus1LByTDoL6NPk57Ays,2929
71
- parrot/loaders/videolocal.py,sha256=o1upjpsMHp1NV4ZQVRc2DS8nKyJI1l0x9p3PjJUr3fU,5018
71
+ parrot/loaders/videolocal.py,sha256=LKtP8YVlI_RWiXi6wYew3_ZB2Up8d8LXlWWDdgU1s7k,5139
72
72
  parrot/loaders/vimeo.py,sha256=zOvOOIiaZr_bRswJFI7uIMKISgALOxcSim9ZRUFY1Fc,4114
73
73
  parrot/loaders/web.py,sha256=3x06JNpfTGFtvSBPAEBVoVdZkpVXePcJeMtj61B2xJk,8867
74
74
  parrot/loaders/web_base.py,sha256=5SjQddT0Vhne8C9s30iU3Ex_9O1PJ8kyDmy8EdhGBo0,4380
@@ -80,7 +80,7 @@ parrot/loaders/utils/__init__.py,sha256=SkDyK3MuPGhp0NM6kHvaxQDe97Gcl3n9t5A741OV
80
80
  parrot/loaders/utils/models.py,sha256=BHcnFzS7oOKUGG-vPy_TlqeFNAC8puRgsIMX2mSgKxY,1059
81
81
  parrot/stores/__init__.py,sha256=ZFjZvcLhcqJqndx9tiEANpyiude1fvjrCxyt2S42VqY,1496
82
82
  parrot/stores/abstract.py,sha256=aqDhkVr5VwdKqg7StroIXf32-11MLyyMAlZuh5hJeCY,5138
83
- parrot/stores/milvus.py,sha256=PZPXbr65Rt9LopTCTY53DWrQ11t6yBHYj_C09zf1s4A,20444
83
+ parrot/stores/milvus.py,sha256=iRi1dO7kathwep3iLIMIDtAkljc-zETUzON4E0wsrYs,20596
84
84
  parrot/stores/qdrant.py,sha256=y-jG5sB6ICESyxdpyGBhQ-hgTDLxxPtM5xYZTWIRiAY,4720
85
85
  parrot/tools/__init__.py,sha256=XKZwogdGr6ObPfAGbzAdyDjFnXI286eapsi180VwdjE,614
86
86
  parrot/tools/abstract.py,sha256=pVSZw8MDpbVcQ-CHaGwP6CpqXHIs8hH8Oy1AqUuMmrw,1706
@@ -103,8 +103,8 @@ resources/users/handlers.py,sha256=BGzqBvPY_OaIF_nONWX4b_B5OyyBrdGuSihIsdlFwjk,2
103
103
  resources/users/models.py,sha256=glk7Emv7QCi6i32xRFDrGc8UwK23_LPg0XUOJoHnwRU,6799
104
104
  settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
105
105
  settings/settings.py,sha256=9ueEvyLNurUX-AaIeRPV8GKX1c4YjDLbksUAeqEq6Ck,1854
106
- ai_parrot-0.3.6.dist-info/LICENSE,sha256=vRKOoa7onTsLNvSzJtGtMaNhWWh8B3YAT733Tlu6M4o,1070
107
- ai_parrot-0.3.6.dist-info/METADATA,sha256=UukaICPH6ngFNm_DU3TmP2E89_BpgchSP0oPLxypwso,9721
108
- ai_parrot-0.3.6.dist-info/WHEEL,sha256=UQ-0qXN3LQUffjrV43_e_ZXj2pgORBqTmXipnkj0E8I,113
109
- ai_parrot-0.3.6.dist-info/top_level.txt,sha256=qHoO4BhYDfeTkyKnciZSQtn5FSLN3Q-P5xCTkyvbuxg,26
110
- ai_parrot-0.3.6.dist-info/RECORD,,
106
+ ai_parrot-0.3.8.dist-info/LICENSE,sha256=vRKOoa7onTsLNvSzJtGtMaNhWWh8B3YAT733Tlu6M4o,1070
107
+ ai_parrot-0.3.8.dist-info/METADATA,sha256=81l4aL6ASc4ERr1DsOSl7RhjnLhbuOGnPoJfqy9IjMg,9721
108
+ ai_parrot-0.3.8.dist-info/WHEEL,sha256=UQ-0qXN3LQUffjrV43_e_ZXj2pgORBqTmXipnkj0E8I,113
109
+ ai_parrot-0.3.8.dist-info/top_level.txt,sha256=qHoO4BhYDfeTkyKnciZSQtn5FSLN3Q-P5xCTkyvbuxg,26
110
+ ai_parrot-0.3.8.dist-info/RECORD,,
@@ -84,11 +84,13 @@ class VideoLocalLoader(BaseVideoLoader):
84
84
  if transcript_whisper:
85
85
  # VTT version:
86
86
  transcript = self.transcript_to_vtt(transcript_whisper, transcript_path)
87
- doc = Document(
88
- page_content=transcript,
89
- metadata=metadata
90
- )
91
- documents.append(doc)
87
+ transcript_chunks = split_text(transcript, 65535)
88
+ for chunk in transcript_chunks:
89
+ doc = Document(
90
+ page_content=chunk,
91
+ metadata=metadata
92
+ )
93
+ documents.append(doc)
92
94
  # Saving every dialog chunk as a separate document
93
95
  dialogs = self.transcript_to_blocks(transcript_whisper)
94
96
  docs = []
parrot/stores/milvus.py CHANGED
@@ -1,12 +1,12 @@
1
1
  from typing import Optional, Union, Any
2
2
  import asyncio
3
- import uuid
4
- import torch
3
+ # import uuid
4
+ # import torch
5
5
  from pymilvus import (
6
6
  MilvusClient,
7
- Collection,
8
- FieldSchema,
9
- CollectionSchema,
7
+ # Collection,
8
+ # FieldSchema,
9
+ # CollectionSchema,
10
10
  DataType,
11
11
  connections,
12
12
  db
@@ -148,10 +148,10 @@ class MilvusStore(AbstractStore):
148
148
  )
149
149
 
150
150
  async def __aenter__(self):
151
- try:
152
- self.tensor = torch.randn(1000, 1000).cuda()
153
- except RuntimeError:
154
- self.tensor = None
151
+ # try:
152
+ # self.tensor = torch.randn(1000, 1000).cuda()
153
+ # except RuntimeError:
154
+ # self.tensor = None
155
155
  if self._embed_ is None:
156
156
  self._embed_ = self.create_embedding(
157
157
  model_name=self.embedding_name
@@ -161,10 +161,10 @@ class MilvusStore(AbstractStore):
161
161
  async def __aexit__(self, exc_type, exc_value, traceback):
162
162
  # closing Embedding
163
163
  self._embed_ = None
164
- del self.tensor
164
+ # del self.tensor
165
165
  try:
166
166
  self.close(alias=self._client_id)
167
- torch.cuda.empty_cache()
167
+ # torch.cuda.empty_cache()
168
168
  except RuntimeError:
169
169
  pass
170
170
 
@@ -199,7 +199,10 @@ class MilvusStore(AbstractStore):
199
199
  connections.disconnect(alias=alias)
200
200
  try:
201
201
  self._client.close()
202
+ except AttributeError:
203
+ pass
202
204
  finally:
205
+ self._client = None
203
206
  self._connected = False
204
207
 
205
208
  def create_db(self, db_name: str, alias: str = 'default', **kwargs) -> bool:
@@ -269,8 +272,9 @@ class MilvusStore(AbstractStore):
269
272
  return self.get_vector()
270
273
 
271
274
  def collection_exists(self, collection_name: str) -> bool:
272
- if collection_name in self._client.list_collections():
273
- return True
275
+ with self.connection():
276
+ if collection_name in self._client.list_collections():
277
+ return True
274
278
  return False
275
279
 
276
280
  def check_state(self, collection_name: str) -> dict:
@@ -478,10 +482,10 @@ class MilvusStore(AbstractStore):
478
482
  ):
479
483
  if not collection:
480
484
  collection = self.collection
481
- try:
482
- tensor = torch.randn(1000, 1000).cuda()
483
- except Exception:
484
- tensor = None
485
+ # try:
486
+ # tensor = torch.randn(1000, 1000).cuda()
487
+ # except Exception:
488
+ # tensor = None
485
489
  if upsert is True:
486
490
  # get first document
487
491
  doc = documents[0]
@@ -510,7 +514,7 @@ class MilvusStore(AbstractStore):
510
514
  vector_field='vector',
511
515
  **kwargs
512
516
  )
513
- del tensor
517
+ # del tensor
514
518
  return docstore
515
519
 
516
520
  def upsert(self, payload: dict, collection: str = None) -> None:
parrot/version.py CHANGED
@@ -3,7 +3,7 @@
3
3
  __title__ = "ai-parrot"
4
4
  __description__ = "Live Chatbots based on Langchain chatbots and Agents \
5
5
  Integrated into Navigator Framework or used into aiohttp applications."
6
- __version__ = "0.3.6"
6
+ __version__ = "0.3.8"
7
7
  __author__ = "Jesus Lara"
8
8
  __author_email__ = "jesuslarag@gmail.com"
9
9
  __license__ = "MIT"