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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cat-llm
3
- Version: 0.0.35
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
 
@@ -26,7 +26,8 @@ classifiers = [
26
26
  ]
27
27
  dependencies = [
28
28
  "pandas",
29
- "tqdm"
29
+ "tqdm",
30
+ "pkg_resources"
30
31
  ]
31
32
 
32
33
  [project.urls]
@@ -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
- reference_image = pkg_resources.resource_filename(
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": reference_image, "detail": "high"}
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 = [
@@ -1,7 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Christopher Soria <chrissoria@berkeley.edu>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.0.35"
4
+ __version__ = "0.0.37"
5
5
  __author__ = "Chris Soria"
6
6
  __email__ = "chrissoria@berkeley.edu"
7
7
  __title__ = "cat-llm"
File without changes
File without changes