-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ [Tasks] JSON Schema spec for Inference types + TS type generation #449
Merged
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
7c50482
add JSON schema spec for audio-classification
SBrandeis fd98112
add JSON schema spec for text-generation
SBrandeis 352e7c5
✨ Add script to generate inference types
SBrandeis 5551f5b
Add generated code
SBrandeis fad594b
💄format with pnpm
SBrandeis 9a8f327
misc fix
SBrandeis 02ba10c
✨ Add specs for existing tasks
SBrandeis 93c37f5
🩹 Ignore placeholder when generating code
SBrandeis bbf72ec
🩹 Fix: ensure spec files exist
SBrandeis 16a9beb
✨ Generate inference types for existing tasks
SBrandeis b27846c
✨ Support cross-file references
SBrandeis 7d9a9f6
regen following header change
SBrandeis dbd0254
✨ Add text2text-generation task & reference it from summarization/tra…
SBrandeis 6d90348
♻️ Use $id, $defs & title
SBrandeis d027115
✨ Add sentence similarity task spec
SBrandeis 224c039
fix typo in text2text-generation spec
SBrandeis b8dae86
regenerate code
SBrandeis b84825e
Have text-to-speech refer to text-to-audio
SBrandeis 4484e39
regenerate code
SBrandeis a9c9ae1
Add quicktype-core from fork
SBrandeis f9fd4f9
regenerate code
SBrandeis d4ec535
💄format with pnpm
SBrandeis 00501a6
Add canonicalId to TaskData
SBrandeis 29fecc0
Fix naming for bounding boxes types
SBrandeis d220a9b
♻️ Better names for intermediate types
SBrandeis 49a1d50
✨ Update placeholder
SBrandeis f4784bf
Changes from code review
SBrandeis a33987f
mark image & question as required in doc QA
SBrandeis 6558af4
Document QA: rename input element to inputsingle
SBrandeis 0724e26
No batching
SBrandeis 29f5975
rename input -> data
SBrandeis 3a98f58
enable explicit-unions when generating
SBrandeis e0a4939
tweaks
SBrandeis 2d46399
🩹 Don't use require in rootDirFinder
SBrandeis c1151c0
Explicit titles
SBrandeis 077a88f
Post-process hack to generate array types
SBrandeis 6b10c4d
regenerate code
SBrandeis c35fe85
e📝 Some comments
SBrandeis 6f1a8b3
💄 Lint
SBrandeis 9d25d28
Add text-to-image pipeline
SBrandeis 499ed5f
Update image-to-image output
SBrandeis bf48f5e
Update image-to-image inputs
SBrandeis 49a8151
Factorize generate parameters
SBrandeis e4f3d13
Correclty type ASR output
SBrandeis 826181a
wip: spec generate parameters
SBrandeis 0000f02
e♻️ Factorize common classification types
SBrandeis 8dc4d17
fix: await writefile in post process
SBrandeis 9ccb3a4
add scheduler param
SBrandeis accdeff
rename schema-utls to common-definitions
SBrandeis 3a3d4ba
proper type for table QA
SBrandeis 4742c9e
oops I forgot to commit the new file after rename
SBrandeis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,10 @@ | |
"format": "prettier --write .", | ||
"format:check": "prettier --check .", | ||
"prepublishOnly": "pnpm run build", | ||
"build": "tsup src/index.ts --format cjs,esm --clean --dts", | ||
"build": "tsup src/index.ts src/scripts/**.ts --format cjs,esm --clean --dts", | ||
"prepare": "pnpm run build", | ||
"check": "tsc" | ||
"check": "tsc", | ||
"inference-codegen": "pnpm run build && node dist/scripts/inference-codegen.js" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should include this directly in the build command |
||
}, | ||
"files": [ | ||
"dist", | ||
|
@@ -40,5 +41,8 @@ | |
], | ||
"author": "Hugging Face", | ||
"license": "MIT", | ||
"devDependencies": {} | ||
"devDependencies": { | ||
"@types/node": "^20.11.5", | ||
"quicktype-core": "https://github.com/huggingface/quicktype/raw/pack-18.0.15/packages/quicktype-core/quicktype-core-18.0.15.tgz" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsup is used for files to be published.
If you just want to run the script, you can take inspiration from
doc-internal
:No need to add
ts-node
, it's already included in the root packageThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ that command fails with a syntax error (
cannot use import outside of a module
or smth)Is it OK tu use
tsc
to compile the script inpnpm run inference-codegen
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add
type: "module"
to thepackage.json