hjxdl 0.1.11__py3-none-any.whl → 0.1.13__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.
- hdl/_version.py +2 -2
- hdl/utils/llm/chat.py +9 -3
- {hjxdl-0.1.11.dist-info → hjxdl-0.1.13.dist-info}/METADATA +1 -1
- {hjxdl-0.1.11.dist-info → hjxdl-0.1.13.dist-info}/RECORD +6 -6
- {hjxdl-0.1.11.dist-info → hjxdl-0.1.13.dist-info}/WHEEL +0 -0
- {hjxdl-0.1.11.dist-info → hjxdl-0.1.13.dist-info}/top_level.txt +0 -0
hdl/_version.py
CHANGED
hdl/utils/llm/chat.py
CHANGED
@@ -347,7 +347,7 @@ class OpenAI_M():
|
|
347
347
|
api_key (str): API key for authentication.
|
348
348
|
client (OpenAI): OpenAI client for making API requests.
|
349
349
|
"""
|
350
|
-
self.model_path = model_path
|
350
|
+
# self.model_path = model_path
|
351
351
|
self.server_ip = server_ip
|
352
352
|
self.server_port = server_port
|
353
353
|
self.base_url = f"http://{self.server_ip}:{str(self.server_port)}/v1"
|
@@ -364,6 +364,7 @@ class OpenAI_M():
|
|
364
364
|
prompt : str,
|
365
365
|
stop: list[str] | None = ["USER:", "ASSISTANT:"],
|
366
366
|
# history: list = [],
|
367
|
+
model="default_model",
|
367
368
|
**kwargs: t.Any,
|
368
369
|
) -> str:
|
369
370
|
"""Invoke the chatbot with the given prompt and return the response.
|
@@ -377,12 +378,14 @@ class OpenAI_M():
|
|
377
378
|
str: The response generated by the chatbot.
|
378
379
|
"""
|
379
380
|
response = self.client.chat.completions.create(
|
380
|
-
model=self.model_path,
|
381
|
+
# model=self.model_path,
|
381
382
|
messages=[{
|
382
383
|
"role": "user",
|
383
384
|
"content": prompt
|
384
385
|
}],
|
385
386
|
stream=False,
|
387
|
+
model=model,
|
388
|
+
# model=kwargs.get("model", "default_model")
|
386
389
|
**kwargs
|
387
390
|
)
|
388
391
|
return response.choices[0].message.content
|
@@ -392,6 +395,7 @@ class OpenAI_M():
|
|
392
395
|
prompt : str,
|
393
396
|
stop: list[str] | None = ["USER:", "ASSISTANT:"],
|
394
397
|
# history: list = [],
|
398
|
+
model="default_model",
|
395
399
|
**kwargs: t.Any,
|
396
400
|
):
|
397
401
|
"""Generate text completion in a streaming fashion.
|
@@ -405,12 +409,14 @@ class OpenAI_M():
|
|
405
409
|
str: The generated text completion in a streaming fashion.
|
406
410
|
"""
|
407
411
|
response = self.client.chat.completions.create(
|
408
|
-
model=self.model_path,
|
412
|
+
# model=self.model_path,
|
409
413
|
messages=[{
|
410
414
|
"role": "user",
|
411
415
|
"content": prompt
|
412
416
|
}],
|
413
417
|
stream=True,
|
418
|
+
model=model,
|
419
|
+
# model=kwargs.get("model", "default_model")
|
414
420
|
**kwargs
|
415
421
|
)
|
416
422
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
hdl/__init__.py,sha256=5sZZNySv08wwfzJcSDssGTqUn9wlmDsR6R4XB8J8mFM,70
|
2
|
-
hdl/_version.py,sha256=
|
2
|
+
hdl/_version.py,sha256=S22EPqqZRb53L2H7sobVA3TUXv9skvkYd-YtLuHuV6M,413
|
3
3
|
hdl/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
hdl/args/loss_args.py,sha256=s7YzSdd7IjD24rZvvOrxLLFqMZQb9YylxKeyelSdrTk,70
|
5
5
|
hdl/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -84,12 +84,12 @@ hdl/utils/database_tools/connect.py,sha256=KUnVG-8raifEJ_N0b3c8LkTTIfn9NIyw8LX6q
|
|
84
84
|
hdl/utils/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
85
|
hdl/utils/general/glob.py,sha256=8-RCnt6L297wMIfn34ZAMCsGCZUjHG3MGglGZI1cX0g,491
|
86
86
|
hdl/utils/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
87
|
-
hdl/utils/llm/chat.py,sha256=
|
87
|
+
hdl/utils/llm/chat.py,sha256=Xypu7KlnTeI9oep02tuw04GooAfysZEgY2T_P29xZuU,15086
|
88
88
|
hdl/utils/llm/embs.py,sha256=Tf0FOYrOFZp7qQpEPiSCXzlgyHH0X9HVTUtsup74a9E,7174
|
89
89
|
hdl/utils/llm/extract.py,sha256=2sK_WJzmYIc8iuWaM9DA6Nw3_6q1O4lJ5pKpcZo-bBA,6512
|
90
90
|
hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
91
91
|
hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
|
92
|
-
hjxdl-0.1.
|
93
|
-
hjxdl-0.1.
|
94
|
-
hjxdl-0.1.
|
95
|
-
hjxdl-0.1.
|
92
|
+
hjxdl-0.1.13.dist-info/METADATA,sha256=UlAuoHbbPfrnFywQuD4azAWgCHUGNpvR8snZAAhdnz4,543
|
93
|
+
hjxdl-0.1.13.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
94
|
+
hjxdl-0.1.13.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
|
95
|
+
hjxdl-0.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|