Skip to content
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

feat: add mgr.load for ModelScope studio repo #20

Merged
merged 17 commits into from
May 20, 2024
Merged
5 changes: 5 additions & 0 deletions .changeset/flat-teachers-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'modelscope_studio': patch
---

feat: expose version from modelscope_studio
14 changes: 14 additions & 0 deletions .changeset/purple-buttons-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@modelscope-studio/waterfall-gallery': minor
'@modelscope-studio/multimodal-input': minor
'@modelscope-studio/lint-config': minor
'@modelscope-studio/markdown': minor
'@modelscope-studio/compiled': minor
'@modelscope-studio/changelog': minor
'@modelscope-studio/chatbot': minor
'@modelscope-studio/shared': minor
'@modelscope-studio/flow': minor
'modelscope_studio': minor
---

feat: upload logic with new gradio version
5 changes: 5 additions & 0 deletions .changeset/rare-houses-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'modelscope_studio': minor
---

feat: add mgr.load for ModelScope studio repo
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: publish

# on:
# disabled for now
# push:
# branches:
# - main
on:
push:
branches:
# - main
- disabled
env:
CI: true

Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.preferTypeOnlyAutoImports": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
Expand Down
2 changes: 1 addition & 1 deletion README-ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span style="font-size: 30px; vertical-align: middle;">
✖️
</span>
<img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
<img src="https://github.com/gradio-app/gradio/raw/main/readme_files/gradio.svg" height="60" style="vertical-align: middle;">
<p>

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span style="font-size: 30px; vertical-align: middle;">
✖️
</span>
<img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
<img src="https://github.com/gradio-app/gradio/raw/main/readme_files/gradio.svg" height="60" style="vertical-align: middle;">
<p>

<p align="center">
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span style="font-size: 30px; vertical-align: middle;">
✖️
</span>
<img src="https://www.gradio.app/_app/immutable/assets/gradio.8a5e8876.svg" height="60" style="vertical-align: middle;">
<img src="https://github.com/gradio-app/gradio/raw/main/readme_files/gradio.svg" height="60" style="vertical-align: middle;">
<p>

<p align="center">
Expand Down
18 changes: 7 additions & 11 deletions backend/modelscope_studio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from .components.Chatbot import ModelScopeChatbot as Chatbot
from .components.Flow import ModelScopeFlow as Flow
from .components.Markdown import ModelScopeMarkdown as Markdown
from .components.MultimodalInput import \
ModelScopeMultimodalInput as MultimodalInput
from .components.WaterfallGallery import \
ModelScopeWaterfallGallery as WaterfallGallery

__all__ = [
'Chatbot', 'Markdown', 'MultimodalInput', 'WaterfallGallery', 'Flow'
]
from .components import ModelScopeChatbot as Chatbot
from .components import ModelScopeFlow as Flow
from .components import ModelScopeMarkdown as Markdown
from .components import ModelScopeMultimodalInput as MultimodalInput
from .components import ModelScopeWaterfallGallery as WaterfallGallery
from .external import load
from .version import __version__
1 change: 0 additions & 1 deletion backend/modelscope_studio/components/Chatbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ def postprocess(
) -> ChatbotData:
if self.data_postprocess:
value = self.data_postprocess(self, value)

value = self.__class__.data_postprocess(self, value)
if value is None:
return ChatbotData(root=[])
Expand Down
2 changes: 1 addition & 1 deletion backend/modelscope_studio/components/Markdown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def as_example(self, input_data: str | None) -> str:
def preprocess(self, payload: str | None) -> str | None:
if self.data_preprocess:
payload = self.data_preprocess(self, payload)
payload = self.__class__.data_postprocess(self, payload)
payload = self.__class__.data_preprocess(self, payload)
return payload

def example_inputs(self) -> Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def preprocess(
payload: MultimodalInputData | None) -> MultimodalInputData | None:
if self.data_preprocess:
payload = self.data_preprocess(self, payload)
payload = self.__class__.data_postprocess(self, payload)
payload = self.__class__.data_preprocess(self, payload)
if payload.files is not None and len(payload.files) > 0:
for i, file in enumerate(payload.files):
if isinstance(file, str):
Expand Down
5 changes: 5 additions & 0 deletions backend/modelscope_studio/components/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .Chatbot import ModelScopeChatbot
from .Flow import ModelScopeFlow
from .Markdown import ModelScopeMarkdown
from .MultimodalInput import ModelScopeMultimodalInput
from .WaterfallGallery import ModelScopeWaterfallGallery
Loading
Loading