Skip to content

Commit 5e04b1c

Browse files
authored
chore: remap chipper to use chipperv2 (#300)
We want this to alias to the current model. Also, wrap the error that comes from chipperv1 becoming a private model. To verify: * Run the server ``` make run-web-app ``` * A call to chipperv1 should give a useful error: ``` curl -X POST 'http://localhost:8000/general/v0/general' --form files="@$file" --form strategy=hi_res --form hi_res_model_name=chipperv1 {"detail":"The Chipper model is not available for download. It can be accessed via the official hosted API."} ``` * Change the model name to `chipper`. You should see `chipperv2` in the log message containing partition input data
1 parent c30a2b8 commit 5e04b1c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 0.0.56-dev1
1+
## 0.0.56
22
* **Add `max_characters` param for chunking** This param gives users additional control to "chunk" elements into larger or smaller `CompositeElement`s
33
* Bump unstructured to 0.10.28
4+
* Make sure chipperv2 is called whien `hi_res_model_name==chipper`
45

56

67
## 0.0.55

prepline_general/api/general.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ def pipeline_api(
346346

347347
hi_res_model_name = m_hi_res_model_name[0] if len(m_hi_res_model_name) else None
348348

349+
# Make sure chipper aliases to the latest model
350+
if hi_res_model_name and hi_res_model_name == "chipper":
351+
hi_res_model_name = "chipperv2"
352+
349353
if hi_res_model_name and hi_res_model_name in CHIPPER_MODEL_TYPES and show_coordinates:
350354
raise HTTPException(
351355
status_code=400,
@@ -476,7 +480,10 @@ def pipeline_api(
476480
elements = partition(**partition_kwargs)
477481

478482
except OSError as e:
479-
if "chipper-fast-fine-tuning is not a local folder" in e.args[0]:
483+
if (
484+
"chipper-fast-fine-tuning is not a local folder" in e.args[0]
485+
or "ved-fine-tuning is not a local folder" in e.args[0]
486+
):
480487
raise HTTPException(
481488
status_code=400,
482489
detail="The Chipper model is not available for download. It can be accessed via the official hosted API.",

0 commit comments

Comments
 (0)