nebu 0.1.31__py3-none-any.whl → 0.1.33__py3-none-any.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.
- nebu/adapter.py +5 -0
- nebu/chatx/convert.py +14 -3
- nebu/processors/consumer.py +1 -0
- {nebu-0.1.31.dist-info → nebu-0.1.33.dist-info}/METADATA +1 -1
- {nebu-0.1.31.dist-info → nebu-0.1.33.dist-info}/RECORD +8 -8
- {nebu-0.1.31.dist-info → nebu-0.1.33.dist-info}/WHEEL +0 -0
- {nebu-0.1.31.dist-info → nebu-0.1.33.dist-info}/licenses/LICENSE +0 -0
- {nebu-0.1.31.dist-info → nebu-0.1.33.dist-info}/top_level.txt +0 -0
nebu/adapter.py
CHANGED
@@ -9,3 +9,8 @@ class Adapter(BaseModel):
|
|
9
9
|
uri: str
|
10
10
|
base_model: str
|
11
11
|
owner: str
|
12
|
+
epochs_trained: int = Field(default=0)
|
13
|
+
last_trained: int = Field(default=0)
|
14
|
+
lora_rank: int = Field(default=8)
|
15
|
+
lora_alpha: int = Field(default=16)
|
16
|
+
lora_dropout: float = Field(default=0.1)
|
nebu/chatx/convert.py
CHANGED
@@ -7,6 +7,11 @@ from typing import Any, Dict, List, Tuple
|
|
7
7
|
import requests
|
8
8
|
from PIL import Image, UnidentifiedImageError
|
9
9
|
|
10
|
+
# Define a standard User-Agent header
|
11
|
+
REQUESTS_HEADERS = {
|
12
|
+
"User-Agent": "Nebulous-py/0.1 (https://github.com/agentsea/nebulous-py; contact@agentsea.ai)"
|
13
|
+
}
|
14
|
+
|
10
15
|
|
11
16
|
def convert_to_unsloth_inference(
|
12
17
|
old_schema: List[Dict[str, Any]],
|
@@ -63,7 +68,7 @@ def convert_to_unsloth_inference(
|
|
63
68
|
# Convert each URL into a PIL image
|
64
69
|
for url in image_urls:
|
65
70
|
# Download the image
|
66
|
-
response = requests.get(url)
|
71
|
+
response = requests.get(url, headers=REQUESTS_HEADERS)
|
67
72
|
response.raise_for_status()
|
68
73
|
image_data = BytesIO(response.content)
|
69
74
|
pil_img = Image.open(image_data).convert("RGB")
|
@@ -199,7 +204,11 @@ def oai_to_unsloth(
|
|
199
204
|
try:
|
200
205
|
if image_url_to_load.startswith(("http://", "https://")):
|
201
206
|
# Handle URL
|
202
|
-
response = requests.get(
|
207
|
+
response = requests.get(
|
208
|
+
image_url_to_load,
|
209
|
+
stream=True,
|
210
|
+
headers=REQUESTS_HEADERS,
|
211
|
+
)
|
203
212
|
response.raise_for_status() # Raise an exception for bad status codes
|
204
213
|
pil_image = Image.open(response.raw)
|
205
214
|
else: # Assume base64
|
@@ -252,7 +261,9 @@ def oai_to_unsloth(
|
|
252
261
|
try:
|
253
262
|
if image_url_top_level.startswith(("http://", "https://")):
|
254
263
|
# Handle URL
|
255
|
-
response = requests.get(
|
264
|
+
response = requests.get(
|
265
|
+
image_url_top_level, stream=True, headers=REQUESTS_HEADERS
|
266
|
+
)
|
256
267
|
response.raise_for_status() # Raise an exception for bad status codes
|
257
268
|
pil_image = Image.open(response.raw)
|
258
269
|
else:
|
nebu/processors/consumer.py
CHANGED
@@ -479,6 +479,7 @@ while True:
|
|
479
479
|
# Read from stream with blocking
|
480
480
|
streams = {REDIS_STREAM: ">"} # '>' means read only new messages
|
481
481
|
# The type checker still struggles here, but the runtime types are asserted.
|
482
|
+
print("reading from stream...")
|
482
483
|
messages = r.xreadgroup( # type: ignore[arg-type]
|
483
484
|
REDIS_CONSUMER_GROUP, consumer_name, streams, count=1, block=5000
|
484
485
|
)
|
@@ -1,17 +1,17 @@
|
|
1
1
|
nebu/__init__.py,sha256=5sepbzdAdoA_8TIxws60S4ugFY1apQd_savzn20a4cY,465
|
2
|
-
nebu/adapter.py,sha256=
|
2
|
+
nebu/adapter.py,sha256=X9Lc0-pm4U6v7UDgOd_RuxJqENqAO8Si4jrwGYTsMGI,418
|
3
3
|
nebu/auth.py,sha256=N_v6SPFD9HU_UoRDTaouH03g2Hmo9C-xxqInE1FweXE,1471
|
4
4
|
nebu/cache.py,sha256=1aY1plIXWOPmUY6GGq_s_QDXzIi5UMuG34XYBA8PpW8,3803
|
5
5
|
nebu/config.py,sha256=aZzQltkobtOLHFCGcIkpKoE3ITn3Z11Dp0E72w84TA0,5769
|
6
6
|
nebu/data.py,sha256=kIH9-JJ1-iO7P2t28bku6Gn0Y5tgQszGeTW_rpmO03A,38725
|
7
7
|
nebu/meta.py,sha256=CzFHMND9seuewzq9zNNx9WTr6JvrCBExe7BLqDSr7lM,745
|
8
|
-
nebu/chatx/convert.py,sha256=
|
8
|
+
nebu/chatx/convert.py,sha256=jIOuGXPfLkYf_cRqh739gsKKg7cBB2zEYm3Jpmf6Xvo,12535
|
9
9
|
nebu/chatx/openai.py,sha256=LLSPvVGnauUViAXY7OifwoWlkUGZWfgxEjxR4mjSqZg,44961
|
10
10
|
nebu/containers/container.py,sha256=yb7KaPTVXnEEAlrpdlUi4HNqF6P7z9bmwAILGlq6iqU,13502
|
11
11
|
nebu/containers/decorator.py,sha256=uFtzlAXRHYZECJ-NPusY7oN9GXvdHrHDd_JNrIGr8aQ,3244
|
12
12
|
nebu/containers/models.py,sha256=0j6NGy4yto-enRDh_4JH_ZTbHrLdSpuMOqNQPnIrwC4,6815
|
13
13
|
nebu/containers/server.py,sha256=yFa2Y9PzBn59E1HftKiv0iapPonli2rbGAiU6r-wwe0,2513
|
14
|
-
nebu/processors/consumer.py,sha256=
|
14
|
+
nebu/processors/consumer.py,sha256=mSgHm6ANcsM1KtmH9Nu-D6X52d6we0Au8m29rcvb57s,19734
|
15
15
|
nebu/processors/decorate.py,sha256=9mf25RawOX6_6WyQcRLBIHQC3oCDtofQZijJ13aQM9E,34576
|
16
16
|
nebu/processors/default.py,sha256=W4slJenG59rvyTlJ7gRp58eFfXcNOTT2Hfi6zzJAobI,365
|
17
17
|
nebu/processors/models.py,sha256=y40HoW-MEzDWB2dm_tsYlUy3Nf3s6eiLC0iGO9BoNog,3956
|
@@ -19,8 +19,8 @@ nebu/processors/processor.py,sha256=EQ3-dBf432fSAQE2A_9ATX-cG5LkJ4fjVaOtlxCoXvc,
|
|
19
19
|
nebu/processors/remote.py,sha256=TeAIPGEMqnDIb7H1iett26IEZrBlcbPB_-DSm6jcH1E,1285
|
20
20
|
nebu/redis/models.py,sha256=coPovAcVXnOU1Xh_fpJL4PO3QctgK9nBe5QYoqEcnxg,1230
|
21
21
|
nebu/services/service.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
nebu-0.1.
|
23
|
-
nebu-0.1.
|
24
|
-
nebu-0.1.
|
25
|
-
nebu-0.1.
|
26
|
-
nebu-0.1.
|
22
|
+
nebu-0.1.33.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
23
|
+
nebu-0.1.33.dist-info/METADATA,sha256=CWQKkWeG-SNK4iLfceWpbF__lHZQFPm0r7I5_1AdHUA,1786
|
24
|
+
nebu-0.1.33.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
25
|
+
nebu-0.1.33.dist-info/top_level.txt,sha256=uLIbEKJeGSHWOAJN5S0i5XBGwybALlF9bYoB1UhdEgQ,5
|
26
|
+
nebu-0.1.33.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|