Skip to content

Commit 36e4c85

Browse files
committed
New hspylib-askai revision: 'v1.2.18' >> No commits
1 parent 347eaf4 commit 36e4c85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+131
-113
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
[![Terminal](https://badgen.net/badge/icon/terminal?icon=terminal&label)](https://github.com/yorevs/homesetup)
88
[![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
9-
[![Release](https://badgen.net/badge/release/v1.2.17/gray)](docs/CHANGELOG.md#unreleased)
9+
[![Release](https://badgen.net/badge/release/v1.2.19/gray)](docs/CHANGELOG.md#unreleased)
1010
[![Donate](https://badgen.net/badge/paypal/donate/yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
1111
[![build-and-test](https://github.com/yorevs/askai/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/yorevs/askai/actions/workflows/build-and-test.yml)
1212

bumpver.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpver]
2-
current_version = "1.2.17"
2+
current_version = "1.2.19"
33
version_pattern = "MAJOR.MINOR.PATCH"
44
commit_message = "++version {old_version} -> {new_version}"
55
commit = false

dependencies.hspd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ package: opentelemetry-proto, version: 1.36.0, mode: compat
6969
package: opentelemetry-semantic-conventions, version: 0.48b0, mode: compat
7070
package: opentelemetry-instrumentation-fastapi, version: 0.48b0, mode: compat
7171
package: opentelemetry-instrumentation-asgi, version: 0.48b0, mode: compat
72-
package: transformers, version: 4.55.2, mode: compat
73-
package: unstructured, version: 0.18.13, mode: compat
74-
package: unstructured[md], version: 0.18.13, mode: compat
75-
package: tiktoken, version: 0.11.0, mode: compat
76-
package: nltk, version: 3.9.1, mode: compat
72+
package: transformers, version: 4.57.3, mode: compat
73+
package: unstructured, version: 0.18.21, mode: compat
74+
package: unstructured[md], version: 0.18.21, mode: compat
75+
package: tiktoken, version: 0.12.0, mode: compat
76+
package: nltk, version: 3.9.2, mode: compat
77+
package: tokenizers, version: 0.22.1, mode: compat
7778

7879
/* Vector Store and Databases */
7980
package: faiss-cpu, version: 1.13.0, mode: compat

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ author = <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior
22
mailTo = yorevs@hotmail.com
33
siteUrl = https://github.com/yorevs/askai
44
app_name = hspylib-askai
5-
app_version = 1.2.17
5+
app_version = 1.2.19
66

77
# Build Tools
88
buildTools = setuptools, wheel, build, twine, bumpver, pipenv, isort, black, mypy, pylint, pdoc, pytest

src/demo/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _*_ coding: utf-8 _*_
22
#
3-
# hspylib-askai v1.2.17
3+
# hspylib-askai v1.2.19
44
#
55
# Package: demo
66
"""Package initialization."""
@@ -14,4 +14,4 @@
1414
'sports_api',
1515
'utils'
1616
]
17-
__version__ = '1.2.17'
17+
__version__ = '1.2.19'

src/demo/components/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _*_ coding: utf-8 _*_
22
#
3-
# hspylib-askai v1.2.17
3+
# hspylib-askai v1.2.19
44
#
55
# Package: demo.components
66
"""Package initialization."""
@@ -15,4 +15,4 @@
1515
'vision_demo',
1616
'webcam_demo'
1717
]
18-
__version__ = '1.2.17'
18+
__version__ = '1.2.19'

src/demo/devel/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _*_ coding: utf-8 _*_
22
#
3-
# hspylib-askai v1.2.17
3+
# hspylib-askai v1.2.19
44
#
55
# Package: demo.devel
66
"""Package initialization."""
@@ -21,4 +21,4 @@
2121
'vision-tests',
2222
'whisper_tests'
2323
]
24-
__version__ = '1.2.17'
24+
__version__ = '1.2.19'

src/demo/features/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# _*_ coding: utf-8 _*_
22
#
3-
# hspylib-askai v1.2.17
3+
# hspylib-askai v1.2.19
44
#
55
# Package: demo.features
66
"""Package initialization."""
@@ -10,4 +10,4 @@
1010
'router_demo',
1111
'tools'
1212
]
13-
__version__ = '1.2.17'
13+
__version__ = '1.2.19'

src/demo/features/rag/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# _*_ coding: utf-8 _*_
22
#
3-
# hspylib-askai v1.2.17
3+
# hspylib-askai v1.2.19
44
#
55
# Package: demo.features.rag
66
"""Package initialization."""
77

88
__all__ = [
99
'x_refs_demo'
1010
]
11-
__version__ = '1.2.17'
11+
__version__ = '1.2.19'

src/demo/features/rag/x_refs_demo.py

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,39 @@
33
from askai.core.support.utilities import display_text
44
from utils import get_resource, init_context
55

6-
if __name__ == "__main__":
7-
queries_files: list[str] = [
8-
"Open 1",
9-
"Open second",
10-
"Open 3",
11-
"Open <AC/DC_Song>",
12-
"Open it",
13-
"Open any",
14-
"Open the most recent",
15-
"Open the most oldest",
16-
"open metalica",
17-
]
18-
init_context("x_refs_demo")
19-
ctx: str = get_resource("songs")
20-
display_text(f"\n```bash\n{ctx}\n```\n")
21-
# Provide the context
22-
shared.context.push("HISTORY", ctx)
23-
shared.context.push("HISTORY", "Is there any song about cars?")
24-
shared.context.push("HISTORY", 'Yes, there is. The song is "Highway to Hell"', "assistant")
25-
for query in queries_files:
26-
print(f"({shared.context.size('HISTORY')}/{shared.context.max_context_size})", "QUESTION: ", query)
27-
resp: str = resolve_x_refs(query)
28-
display_text(f"Response: {resp}")
6+
# if __name__ == "__main__":
7+
# queries_files: list[str] = [
8+
# "Open 1",
9+
# "Open second",
10+
# "Open 3",
11+
# "Open <AC/DC_Song>",
12+
# "Open it",
13+
# "Open any",
14+
# "Open the most recent",
15+
# "Open the most oldest",
16+
# "open metalica",
17+
# ]
18+
# init_context("x_refs_demo")
19+
# ctx: str = get_resource("songs")
20+
# display_text(f"\n```bash\n{ctx}\n```\n")
21+
# # Provide the context
22+
# shared.context.push("HISTORY", ctx)
23+
# shared.context.push("HISTORY", "Is there any song about cars?")
24+
# shared.context.push("HISTORY", 'Yes, there is. The song is "Highway to Hell"', "assistant")
25+
# for query in queries_files:
26+
# print(f"({shared.context.size('HISTORY')}/{shared.context.max_context_size})", "QUESTION: ", query)
27+
# resp: str = resolve_x_refs(query)
28+
# display_text(f"Response: {resp}")
29+
30+
from tokenizers.decoders import DecodeStream
31+
from transformers import AutoTokenizer
32+
tok = AutoTokenizer.from_pretrained('meta-llama/Meta-Llama-3-8B-Instruct')
33+
stream = DecodeStream(skip_special_tokens=False)
34+
35+
prompt = "To modify below `HTML` to `{{ '{KEY}' | transalte }}` obeys below Keys.\nExample:\n{{ 'Text.Action\\_Edit' | transalte }}\nKeys:\nText.Action\\_Edit\nText.Action\\_Log\nText.Action\\_View\nText.Action\\_Clone\nText.Action\\_Credit\nText.Action\\_CancelReward\nHTML:\n \n [View](#)\n[Edit](17.reward-template-setting.html)\n[Clone](#)\n[Credit](#)\n[Cancel Rewards](#)\n[Log](#)"
36+
37+
token_ids = tok(prompt).input_ids
38+
# [1271, 5719, 3770, 1595, 5959, 63, 311, 1595, 3052, 11834, 4889, 11923, 765, 1380, 93420, 3954, 63, 98502, 1065, 3770, 25104, 627, 13617, 512, 3052, 364, 1199, 11614, 76838, 4126, 6, 765, 1380, 93420, 8256, 9026, 512, 1199, 11614, 76838, 4126, 198, 1199, 11614, 76838, 2250, 198, 1199, 11614, 76838, 860, 198, 1199, 11614, 76838, 38777, 198, 1199, 11614, 76838, 34593, 198, 1199, 11614, 76838, 9453, 60722, 198, 5959, 512, 720, 510, 860, 9725, 2, 340, 58, 4126, 9725, 1114, 83480, 34509, 61556, 2628, 340, 58, 38777, 9725, 2, 340, 58, 34593, 9725, 2, 340, 58, 9453, 50868, 9725, 2, 340, 58, 2250, 9725, 2, 8]
39+
40+
for token_id in token_ids:
41+
stream.step(tok._tokenizer, token_id)

0 commit comments

Comments
 (0)