Apply prettier

This commit is contained in:
Marcus Blättermann 2022-11-02 16:56:57 +01:00
parent d62a1d3f9c
commit 87d1bcfcf4
No known key found for this signature in database
GPG Key ID: A1E1F04008AC450D
4 changed files with 30 additions and 10 deletions

View File

@ -123,7 +123,7 @@ function formatVectors(data) {
}
function formatAccuracy(data, lang) {
const exclude = (lang !== "ja") ? ['speed'] : ['speed', 'morph_acc']
const exclude = lang !== 'ja' ? ['speed'] : ['speed', 'morph_acc']
if (!data) return []
return Object.keys(data)
.map(label => {
@ -143,7 +143,11 @@ function formatDownloadLink(lang, name, version) {
const fullName = `${lang}_${name}-${version}`
const filename = `${fullName}-py3-none-any.whl`
const url = `https://github.com/explosion/spacy-models/releases/download/${fullName}/${filename}`
return <Link to={url} hideIcon>{filename}</Link>
return (
<Link to={url} hideIcon>
{filename}
</Link>
)
}
function formatModelMeta(data) {
@ -210,7 +214,8 @@ const Model = ({
const [isError, setIsError] = useState(true)
const [meta, setMeta] = useState({})
const { type, genre, size } = getModelComponents(name)
const display_type = type === 'core' && (size === 'sm' || size === 'trf') ? 'core_no_vectors' : type
const display_type =
type === 'core' && (size === 'sm' || size === 'trf') ? 'core_no_vectors' : type
const version = useMemo(() => getLatestVersion(name, compatibility, prereleases), [
name,
compatibility,

View File

@ -142,7 +142,13 @@ const UniverseContent = ({ content = [], categories, theme, pageContext, mdxComp
The Universe database is open-source and collected in a simple JSON file.
For more details on the formats and available fields, see the documentation.
Looking for inspiration your own spaCy plugin or extension? Check out the
<Link to={"https://github.com/explosion/spaCy/discussions/categories/new-features-project-ideas/"} hideIcon ws>
<Link
to={
'https://github.com/explosion/spaCy/discussions/categories/new-features-project-ideas/'
}
hideIcon
ws
>
project idea
</Link>
section in Discussions.

View File

@ -43,7 +43,7 @@ const QuickstartInstall = ({ id, title }) => {
const modelExtras = train ? selectedModels.filter(m => LANG_EXTRAS.includes(m)) : []
const apple = os === 'mac' && platform === 'arm'
const pipExtras = [
(hardware === 'gpu' && (platform !== 'arm' || os === 'linux')) && cuda,
hardware === 'gpu' && (platform !== 'arm' || os === 'linux') && cuda,
train && 'transformers',
train && 'lookups',
apple && 'apple',
@ -220,7 +220,8 @@ const QuickstartInstall = ({ id, title }) => {
<QS package="source">cd spaCy</QS>
<QS package="source">pip install -r requirements.txt</QS>
<QS package="source">
pip install --no-build-isolation --editable {train || hardware == 'gpu' ? `'.[${pipExtras}]'` : '.'}
pip install --no-build-isolation --editable{' '}
{train || hardware == 'gpu' ? `'.[${pipExtras}]'` : '.'}
</QS>
<QS config="train" package="conda" comment prompt={false}>
# packages only available via pip

View File

@ -10,7 +10,15 @@ const DEFAULT_LANG = 'en'
const DEFAULT_HARDWARE = 'cpu'
const DEFAULT_OPT = 'efficiency'
const DEFAULT_TEXTCAT_EXCLUSIVE = true
const COMPONENTS = ['tagger', 'morphologizer', 'trainable_lemmatizer', 'parser', 'ner', 'spancat', 'textcat']
const COMPONENTS = [
'tagger',
'morphologizer',
'trainable_lemmatizer',
'parser',
'ner',
'spancat',
'textcat',
]
const COMMENT = `# This is an auto-generated partial config. To use it with 'spacy train'
# you can run spacy init fill-config to auto-fill all default settings:
# python -m spacy init fill-config ./base_config.cfg ./config.cfg`