fix(medcat-trainer): Fix remote model service errors on cache_project…#363
fix(medcat-trainer): Fix remote model service errors on cache_project…#363alhendrickson merged 3 commits intomainfrom
Conversation
…_model and call_remote_model_service
mart-r
left a comment
There was a problem hiding this comment.
Looks good to me overall.
Clearly Cursor made this original implementatio nin #264 . My best guess is that it didn't check the actual API it was targetting in medcat-service and Tom didn't run a full end to end integration test.
But you're right, it's best to have him comment on it once he's back and at the same time allow you to continue your stuff.
| raise Exception(f"Failed to process remote model service response: {str(e)}") from e | ||
|
|
||
|
|
||
| def call_remote_model_service_medcat(service_url, text): |
There was a problem hiding this comment.
This is very similar to the call_remote_model_service_spacy method above. The only difference in the setup is the payload and then when reading output the entities are read differently. So there's a bunch of duplicate code other than that.
I suppose your purpose was to keep both and (probably) just remove the old / incorrect implementation later down the line.
There was a problem hiding this comment.
Yeah I 100% planned to just delete one of them later.
As a side note - the original payload it tried to use is much closer to the one I'd also want medcat-service to have, so I'm open to there being some other service api going around... eg I think cohort has built its own.
There was a problem hiding this comment.
Cheers - I've added a test for this too, it hits the same APIs the UI will. As I've used cursor to fix cursor it feels like an infinite loop / infinite revenue for them . This is until the planet runs out of resources anyway.
Discussion
Current behavior
Underlying call is this. Service prints no logs.
Fixed behavior
Details of each line
Add logging
Fix service payload
Fix metatask2obj error
I commented out the unused code in utils.py to get
metatask2obj, instead of fixing it. The variable was unused