Skip to content

Conversation

@xianbaoqian
Copy link
Contributor

@xianbaoqian xianbaoqian commented Dec 22, 2022

From the review comment by Julien. Context: #552 (comment)

Although semantically the two maps should be the same and one should generate another, but in practice, there are a few differences.

IIUC, TASKS_MODEL_LIBRARIES is only used for task page and it seems to be manually maintained.
LIBRARY_TASK_MAPPING_EXCLUDING_TRANSFORMERS is used for inference and is auto-generated from api-inference-community.

This PR is only about refactoring the existing code, not about merging the two together. Just a few thoughts on the merging:

I think the latter is more reliable and probably more up-to-date also, but not sure if we will have a case where we can show a library on the task page, even if the inference API is not ready. Also the latter doesn't have any information on transformers and assume that transformers can handle all tasks, which is not really the case per the former, so merging the two is not enough unless we have a new list of tasks that transformers can't handle :-)

@Pierrci
Copy link
Member

Pierrci commented Dec 22, 2022

I think the import type { ModelLibraryKey } from "./Libraries"; in Types.ts can then be removed?

@xianbaoqian xianbaoqian requested a review from Pierrci December 23, 2022 13:02
@xianbaoqian
Copy link
Contributor Author

Thanks @Pierrci ! Removed.

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah i was not suggesting that you merge the two mappings, just that they were similar.

i'd rather have the mapping in a file by itself (see my suggestion)

Thanks!

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@xianbaoqian xianbaoqian merged commit 5af626e into main Dec 23, 2022
@xianbaoqian xianbaoqian deleted the xianbao-refactor branch December 23, 2022 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants