cat-llm 0.0.30__py3-none-any.whl → 0.0.32__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.
- {cat_llm-0.0.30.dist-info → cat_llm-0.0.32.dist-info}/METADATA +1 -1
- cat_llm-0.0.32.dist-info/RECORD +9 -0
- catllm/CERAD_functions.py +6 -5
- catllm/__about__.py +1 -1
- catllm/__init__.py +1 -1
- catllm/image_functions.py +3 -3
- cat_llm-0.0.30.dist-info/RECORD +0 -9
- {cat_llm-0.0.30.dist-info → cat_llm-0.0.32.dist-info}/WHEEL +0 -0
- {cat_llm-0.0.30.dist-info → cat_llm-0.0.32.dist-info}/licenses/LICENSE +0 -0
- /catllm/{cat_llm.py → text_functions.py} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cat-llm
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.32
|
|
4
4
|
Summary: A tool for categorizing text data and images using LLMs and vision models
|
|
5
5
|
Project-URL: Documentation, https://github.com/chrissoria/cat-llm#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/chrissoria/cat-llm/issues
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
catllm/CERAD_functions.py,sha256=fiSiBnCcFgNp5XmGhZULnToEoMyP5z6JMcH-aWC8q5o,18787
|
|
2
|
+
catllm/__about__.py,sha256=TRcq8nZQQ7HQVhDvGX9Y2Zu3S7fzZzv_JDdqeeeYkr8,404
|
|
3
|
+
catllm/__init__.py,sha256=BpAG8nPhM3ZQRd0WqkubI_36-VCOs4eCYtGVgzz48Bs,337
|
|
4
|
+
catllm/image_functions.py,sha256=9e4V1IEMZUFrH00yEjyowwTUKeXWGsln0U1iQ-DELTY,31359
|
|
5
|
+
catllm/text_functions.py,sha256=TNsjYKpr8ZH9jeAYN-4DcFcrnR8x2eRl99oXzpdhE0Q,16910
|
|
6
|
+
cat_llm-0.0.32.dist-info/METADATA,sha256=TUOCnGXRsDP2H62Xfns3djY4271CUiLCnZIiP31_s2E,1679
|
|
7
|
+
cat_llm-0.0.32.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
cat_llm-0.0.32.dist-info/licenses/LICENSE,sha256=wJLsvOr6lrFUDcoPXExa01HOKFWrS3JC9f0RudRw8uw,1075
|
|
9
|
+
cat_llm-0.0.32.dist-info/RECORD,,
|
catllm/CERAD_functions.py
CHANGED
|
@@ -151,7 +151,7 @@ def cerad_drawn_score(
|
|
|
151
151
|
{
|
|
152
152
|
"type": "image_url",
|
|
153
153
|
"image_url": {"url": encoded_image, "detail": "high"},
|
|
154
|
-
}
|
|
154
|
+
}
|
|
155
155
|
]
|
|
156
156
|
elif model_source == "Anthropic":
|
|
157
157
|
prompt = [
|
|
@@ -177,14 +177,14 @@ def cerad_drawn_score(
|
|
|
177
177
|
"media_type": "image/jpeg",
|
|
178
178
|
"data": encoded
|
|
179
179
|
}
|
|
180
|
-
}
|
|
180
|
+
}
|
|
181
181
|
]
|
|
182
182
|
|
|
183
183
|
elif model_source == "Mistral":
|
|
184
184
|
prompt = [
|
|
185
185
|
{
|
|
186
|
-
"
|
|
187
|
-
"
|
|
186
|
+
"type": "text",
|
|
187
|
+
"text": (
|
|
188
188
|
f"You are an image-tagging assistant trained in the CERAD Constructional Praxis test.\n"
|
|
189
189
|
f"Task ► Examine the attached image and decide, **for each category below**, "
|
|
190
190
|
f"whether it is PRESENT (1) or NOT PRESENT (0).\n\n"
|
|
@@ -199,7 +199,7 @@ def cerad_drawn_score(
|
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
201
|
"type": "image_url",
|
|
202
|
-
"image_url": f"data:image/jpeg;base64,{
|
|
202
|
+
"image_url": f"data:image/jpeg;base64,{encoded}"
|
|
203
203
|
}
|
|
204
204
|
]
|
|
205
205
|
|
|
@@ -236,6 +236,7 @@ def cerad_drawn_score(
|
|
|
236
236
|
|
|
237
237
|
elif model_source == "Mistral":
|
|
238
238
|
from mistralai import Mistral
|
|
239
|
+
reply = None
|
|
239
240
|
client = Mistral(api_key=api_key)
|
|
240
241
|
try:
|
|
241
242
|
response = client.chat.complete(
|
catllm/__about__.py
CHANGED
catllm/__init__.py
CHANGED
catllm/image_functions.py
CHANGED
|
@@ -72,7 +72,7 @@ def image_multi_class(
|
|
|
72
72
|
|
|
73
73
|
# Handle extension safely
|
|
74
74
|
ext = Path(img_path).suffix.lstrip(".").lower()
|
|
75
|
-
if model_source == "OpenAI":
|
|
75
|
+
if model_source == "OpenAI" or model_source == "Mistral":
|
|
76
76
|
encoded_image = f"data:image/{ext};base64,{encoded}"
|
|
77
77
|
prompt = [
|
|
78
78
|
{
|
|
@@ -309,7 +309,7 @@ def image_score(
|
|
|
309
309
|
ext = Path(img_path).suffix.lstrip(".").lower()
|
|
310
310
|
encoded_image = f"data:image/{ext};base64,{encoded}"
|
|
311
311
|
|
|
312
|
-
if model_source == "OpenAI":
|
|
312
|
+
if model_source == "OpenAI" or model_source == "Mistral":
|
|
313
313
|
prompt = [
|
|
314
314
|
{
|
|
315
315
|
"type": "text",
|
|
@@ -575,7 +575,7 @@ def image_features(
|
|
|
575
575
|
ext = Path(img_path).suffix.lstrip(".").lower()
|
|
576
576
|
encoded_image = f"data:image/{ext};base64,{encoded}"
|
|
577
577
|
|
|
578
|
-
if model_source == "OpenAI":
|
|
578
|
+
if model_source == "OpenAI" or model_source == "Mistral":
|
|
579
579
|
prompt = [
|
|
580
580
|
{
|
|
581
581
|
"type": "text",
|
cat_llm-0.0.30.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
catllm/CERAD_functions.py,sha256=OQOkCjC0J0ZiandP2J7YCx39KgdndJN3fAzq5XHYozs,18774
|
|
2
|
-
catllm/__about__.py,sha256=YibkqP-aDZxbnylzJCTNLSTsAvGv9UhLUggZCWgK6kQ,404
|
|
3
|
-
catllm/__init__.py,sha256=kLk180aJna1s-wU6CLr4_hKkbjoeET-11jGmC1pdhQw,330
|
|
4
|
-
catllm/cat_llm.py,sha256=TNsjYKpr8ZH9jeAYN-4DcFcrnR8x2eRl99oXzpdhE0Q,16910
|
|
5
|
-
catllm/image_functions.py,sha256=JLlv5qQhAQzgsRIY18rUPtM1P7x1Fw2UlWlI1dpv3dA,31272
|
|
6
|
-
cat_llm-0.0.30.dist-info/METADATA,sha256=U0z9dm0ZCtDS5opnhns2irSQjQP00qlRqQEljPy_tG8,1679
|
|
7
|
-
cat_llm-0.0.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
-
cat_llm-0.0.30.dist-info/licenses/LICENSE,sha256=wJLsvOr6lrFUDcoPXExa01HOKFWrS3JC9f0RudRw8uw,1075
|
|
9
|
-
cat_llm-0.0.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|