xjlulu commited on
Commit
8e2ee04
1 Parent(s): e592bc7
__pycache__/dataset.cpython-39.pyc DELETED
Binary file (2.76 kB)
 
__pycache__/model.cpython-39.pyc DELETED
Binary file (2.21 kB)
 
__pycache__/seafoam.cpython-39.pyc DELETED
Binary file (2.07 kB)
 
__pycache__/utils.cpython-39.pyc DELETED
Binary file (2.72 kB)
 
app.py CHANGED
@@ -7,7 +7,6 @@ import pickle
7
  from pathlib import Path
8
  from utils import Vocab
9
  from model import SeqClassifier
10
- from seafoam import Seafoam
11
 
12
  # Set model parameters
13
  max_len = 128
@@ -71,9 +70,6 @@ def classify(text):
71
  prediction = idx2label(Predicted_class)
72
  return "Category:" + prediction
73
 
74
- # Use the Seafoam theme
75
- seafoam = Seafoam()
76
-
77
  # Create a Gradio interface
78
  demo = gr.Interface(
79
  fn=classify,
@@ -89,7 +85,7 @@ demo = gr.Interface(
89
  ],
90
  title="Text Intent Classification Demo",
91
  description="This demo uses a model to classify text into different intents or categories. Enter a text and see the classification result.",
92
- theme=seafoam
93
  )
94
 
95
  # Launch the Gradio interface
 
7
  from pathlib import Path
8
  from utils import Vocab
9
  from model import SeqClassifier
 
10
 
11
  # Set model parameters
12
  max_len = 128
 
70
  prediction = idx2label(Predicted_class)
71
  return "Category:" + prediction
72
 
 
 
 
73
  # Create a Gradio interface
74
  demo = gr.Interface(
75
  fn=classify,
 
85
  ],
86
  title="Text Intent Classification Demo",
87
  description="This demo uses a model to classify text into different intents or categories. Enter a text and see the classification result.",
88
+ theme="gradio/seafoam"
89
  )
90
 
91
  # Launch the Gradio interface
seafoam.py DELETED
@@ -1,58 +0,0 @@
1
- from __future__ import annotations
2
- from typing import Iterable
3
- import gradio as gr
4
- from gradio.themes.base import Base
5
- from gradio.themes.utils import colors, fonts, sizes
6
- import time
7
-
8
- class Seafoam(Base):
9
- def __init__(
10
- self,
11
- *,
12
- primary_hue: colors.Color | str = colors.emerald,
13
- secondary_hue: colors.Color | str = colors.blue,
14
- neutral_hue: colors.Color | str = colors.blue,
15
- spacing_size: sizes.Size | str = sizes.spacing_md,
16
- radius_size: sizes.Size | str = sizes.radius_md,
17
- text_size: sizes.Size | str = sizes.text_lg,
18
- font: fonts.Font
19
- | str
20
- | Iterable[fonts.Font | str] = (
21
- fonts.GoogleFont("Quicksand"),
22
- "ui-sans-serif",
23
- "sans-serif",
24
- ),
25
- font_mono: fonts.Font
26
- | str
27
- | Iterable[fonts.Font | str] = (
28
- fonts.GoogleFont("IBM Plex Mono"),
29
- "ui-monospace",
30
- "monospace",
31
- ),
32
- ):
33
- super().__init__(
34
- primary_hue=primary_hue,
35
- secondary_hue=secondary_hue,
36
- neutral_hue=neutral_hue,
37
- spacing_size=spacing_size,
38
- radius_size=radius_size,
39
- text_size=text_size,
40
- font=font,
41
- font_mono=font_mono,
42
- )
43
- super().set(
44
- body_background_fill="repeating-linear-gradient(45deg, *primary_200, *primary_200 10px, *primary_50 10px, *primary_50 20px)",
45
- body_background_fill_dark="repeating-linear-gradient(45deg, *primary_800, *primary_800 10px, *primary_900 10px, *primary_900 20px)",
46
- button_primary_background_fill="linear-gradient(90deg, *primary_300, *secondary_400)",
47
- button_primary_background_fill_hover="linear-gradient(90deg, *primary_200, *secondary_300)",
48
- button_primary_text_color="white",
49
- button_primary_background_fill_dark="linear-gradient(90deg, *primary_600, *secondary_800)",
50
- slider_color="*secondary_300",
51
- slider_color_dark="*secondary_600",
52
- block_title_text_weight="600",
53
- block_border_width="3px",
54
- block_shadow="*shadow_drop_lg",
55
- button_shadow="*shadow_drop_lg",
56
- button_large_padding="32px",
57
- )
58
-