-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #526 from ProteinsWebTeam/dev
Release 97.0
- Loading branch information
Showing
21 changed files
with
405 additions
and
182 deletions.
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
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
68 changes: 68 additions & 0 deletions
68
src/components/Description/DescriptionLLM/__snapshots__/test.js.snap
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<DescriptionLLM /> should render 1`] = ` | ||
<React.Fragment> | ||
<div | ||
className="row" | ||
> | ||
<div | ||
className="columns large-12" | ||
> | ||
<div | ||
className="callout warning" | ||
style={ | ||
{ | ||
"alignItems": "center", | ||
"display": "flex", | ||
} | ||
} | ||
> | ||
<span | ||
className="small icon icon-common icon-exclamation-triangle" | ||
style={ | ||
{ | ||
"color": "#664d03", | ||
"fontSize": "2em", | ||
"paddingRight": "1rem", | ||
} | ||
} | ||
/> | ||
<p> | ||
This description has been automatically generated using | ||
<Memo(Connect(Link)) | ||
href="https://openai.com/research/gpt-4" | ||
target="_blank" | ||
> | ||
GPT-4 | ||
</Memo(Connect(Link))> | ||
, an AI language model, and is based on data extracted from | ||
<Memo(Connect(Link)) | ||
href="https://www.uniprot.org" | ||
target="_blank" | ||
> | ||
UniProtKB/Swiss-Prot | ||
</Memo(Connect(Link))> | ||
. It has not undergone a thorough review by curators. Please exercise discretion when interpreting the information provided and consider it as preliminary. | ||
<br /> | ||
<Memo(Connect(Link)) | ||
href="https://interpro-documentation.readthedocs.io/en/latest/llm_descriptions.html" | ||
target="_blank" | ||
> | ||
Read more on description generation | ||
</Memo(Connect(Link))> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<Description | ||
textBlocks={ | ||
[ | ||
"<p>The function of the family is not clear.</p>", | ||
] | ||
} | ||
/> | ||
</React.Fragment> | ||
`; |
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React, { PureComponent } from 'react'; | ||
|
||
import cssBinder from 'styles/cssBinder'; | ||
import globalStyles from 'styles/interpro-vf.css'; | ||
import fonts from 'EBI-Icon-fonts/fonts.css'; | ||
import Link from 'components/generic/Link'; | ||
|
||
import Description from '..'; | ||
import config from 'config'; | ||
|
||
const css = cssBinder(globalStyles, fonts); | ||
|
||
type Props = { | ||
text: string; | ||
}; | ||
|
||
class DescriptionLLM extends PureComponent<Props> { | ||
render() { | ||
const text = this.props.text || ''; | ||
if (text.length === 0) return null; | ||
|
||
return ( | ||
<> | ||
<div className={css('row')}> | ||
<div className={css('columns', 'large-12')}> | ||
<div | ||
className={css('callout', 'warning')} | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
}} | ||
> | ||
<span | ||
style={{ | ||
fontSize: '2em', | ||
color: '#664d03', | ||
paddingRight: '1rem', | ||
}} | ||
className={css( | ||
'small', | ||
'icon', | ||
'icon-common', | ||
'icon-exclamation-triangle' | ||
)} | ||
/>{' '} | ||
<p> | ||
This description has been automatically generated using{' '} | ||
<Link href="https://openai.com/research/gpt-4" target="_blank"> | ||
GPT-4 | ||
</Link> | ||
, an AI language model, and is based on data extracted from{' '} | ||
<Link href="https://www.uniprot.org" target="_blank"> | ||
UniProtKB/Swiss-Prot | ||
</Link> | ||
. It has not undergone a thorough review by curators. Please | ||
exercise discretion when interpreting the information provided | ||
and consider it as preliminary. | ||
<br /> | ||
<Link | ||
href={`${config.root.readthedocs.href}llm_descriptions.html`} | ||
target="_blank" | ||
> | ||
Read more on description generation | ||
</Link> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<Description textBlocks={[text]} /> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
export default DescriptionLLM; |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
|
||
import DescriptionLLM from '.'; | ||
|
||
const renderer = new ShallowRenderer(); | ||
const description = '<p>The function of the family is not clear.</p>'; | ||
|
||
describe('<DescriptionLLM />', () => { | ||
test('should render', () => { | ||
renderer.render(<DescriptionLLM text={description} />); | ||
expect(renderer.getRenderOutput()).toMatchSnapshot(); | ||
}); | ||
}); |
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
Oops, something went wrong.