cat-llm 0.0.35__tar.gz → 0.0.37__tar.gz
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.35 → cat_llm-0.0.37}/PKG-INFO +2 -1
- {cat_llm-0.0.35 → cat_llm-0.0.37}/pyproject.toml +2 -1
- {cat_llm-0.0.35 → cat_llm-0.0.37}/src/catllm/CERAD_functions.py +21 -7
- {cat_llm-0.0.35 → cat_llm-0.0.37}/src/catllm/__about__.py +1 -1
- cat_llm-0.0.37/src/catllm/images/circle.png +0 -0
- cat_llm-0.0.37/src/catllm/images/cube.png +0 -0
- cat_llm-0.0.37/src/catllm/images/diamond.png +0 -0
- cat_llm-0.0.37/src/catllm/images/overlapping_pentagons.png +0 -0
- cat_llm-0.0.37/src/catllm/images/rectangles.png +0 -0
- {cat_llm-0.0.35 → cat_llm-0.0.37}/LICENSE +0 -0
- {cat_llm-0.0.35 → cat_llm-0.0.37}/README.md +0 -0
- {cat_llm-0.0.35 → cat_llm-0.0.37}/src/catllm/__init__.py +0 -0
- {cat_llm-0.0.35 → cat_llm-0.0.37}/src/catllm/image_functions.py +0 -0
- {cat_llm-0.0.35 → cat_llm-0.0.37}/src/catllm/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.37
|
|
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
|
|
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
20
20
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
21
21
|
Requires-Python: >=3.8
|
|
22
22
|
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: pkg-resources
|
|
23
24
|
Requires-Dist: tqdm
|
|
24
25
|
Description-Content-Type: text/markdown
|
|
25
26
|
|
|
@@ -108,9 +108,10 @@ def cerad_drawn_score(
|
|
|
108
108
|
cat_num = len(categories)
|
|
109
109
|
category_dict = {str(i+1): "0" for i in range(cat_num)}
|
|
110
110
|
example_JSON = json.dumps(category_dict, indent=4)
|
|
111
|
+
|
|
111
112
|
#pulling in the reference image if provided
|
|
112
113
|
if provide_reference:
|
|
113
|
-
|
|
114
|
+
reference_image_path = pkg_resources.resource_filename(
|
|
114
115
|
'catllm',
|
|
115
116
|
f'images/{shape}.png' # e.g., "circle.png"
|
|
116
117
|
)
|
|
@@ -164,14 +165,14 @@ def cerad_drawn_score(
|
|
|
164
165
|
if provide_reference:
|
|
165
166
|
prompt.append({
|
|
166
167
|
"type": "image_url",
|
|
167
|
-
"image_url": {"url":
|
|
168
|
+
"image_url": {"url": encoded_ref_image, "detail": "high"}
|
|
168
169
|
})
|
|
169
170
|
|
|
170
171
|
prompt.append({
|
|
171
172
|
"type": "image_url",
|
|
172
173
|
"image_url": {"url": encoded_image, "detail": "high"}
|
|
173
174
|
})
|
|
174
|
-
|
|
175
|
+
|
|
175
176
|
elif model_source == "Anthropic":
|
|
176
177
|
prompt = [
|
|
177
178
|
{
|
|
@@ -188,16 +189,29 @@ def cerad_drawn_score(
|
|
|
188
189
|
f"Example:\n"
|
|
189
190
|
f"{example_JSON}"
|
|
190
191
|
),
|
|
191
|
-
}
|
|
192
|
-
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
|
|
195
|
+
if provide_reference:
|
|
196
|
+
prompt.append({
|
|
197
|
+
"type": "image",
|
|
198
|
+
"source": {
|
|
199
|
+
"type": "base64",
|
|
200
|
+
"media_type": "image/png",
|
|
201
|
+
"data": encoded_ref
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
prompt.append({
|
|
193
207
|
"type": "image",
|
|
194
208
|
"source": {
|
|
195
209
|
"type": "base64",
|
|
196
210
|
"media_type": "image/jpeg",
|
|
197
211
|
"data": encoded
|
|
198
212
|
}
|
|
199
|
-
|
|
200
|
-
|
|
213
|
+
}
|
|
214
|
+
)
|
|
201
215
|
|
|
202
216
|
elif model_source == "Mistral":
|
|
203
217
|
prompt = [
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|