LPX
commited on
Commit
·
f54d46f
1
Parent(s):
af8c793
testing
Browse files
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
|
|
|
|
3 |
from transformers import pipeline, AutoImageProcessor, SwinForImageClassification, Swinv2ForImageClassification, AutoFeatureExtractor, AutoModelForImageClassification
|
4 |
from torchvision import transforms
|
5 |
import torch
|
@@ -304,18 +306,17 @@ with gr.Blocks(css="#post-gallery { overflow: hidden !important;} .grid-wrap{ ov
|
|
304 |
|
305 |
with gr.Tab("🥇 Leaderboard"):
|
306 |
# Add components for the second interface here
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
)
|
319 |
|
320 |
# Launch the interface
|
321 |
iface.launch()
|
|
|
1 |
import spaces
|
2 |
import gradio as gr
|
3 |
+
import modelscope_studio.components.antd as antd
|
4 |
+
import modelscope_studio.components.base as ms
|
5 |
from transformers import pipeline, AutoImageProcessor, SwinForImageClassification, Swinv2ForImageClassification, AutoFeatureExtractor, AutoModelForImageClassification
|
6 |
from torchvision import transforms
|
7 |
import torch
|
|
|
306 |
|
307 |
with gr.Tab("🥇 Leaderboard"):
|
308 |
# Add components for the second interface here
|
309 |
+
with ms.Application() as app:
|
310 |
+
with antd.ConfigProvider():
|
311 |
+
# Example: Add a simple text input and output
|
312 |
+
text_input = gr.Textbox(label="Enter Text")
|
313 |
+
text_output = gr.Textbox(label="Processed Text")
|
314 |
+
text_button = gr.Button("Process Text")
|
315 |
+
text_button.click(
|
316 |
+
fn=lambda x: x.upper(), # Example function to convert text to uppercase
|
317 |
+
inputs=text_input,
|
318 |
+
outputs=text_output
|
319 |
+
)
|
|
|
320 |
|
321 |
# Launch the interface
|
322 |
iface.launch()
|