sundea commited on
Commit
4d78ff4
·
1 Parent(s): 885b3fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -76
app.py CHANGED
@@ -99,82 +99,8 @@ def greet(text):
99
  # print('类别为:{}'.format(classes[predic[0]]))
100
  return classes[predic[0]]
101
 
102
- css = """
103
- body {
104
- background-color: #f6f6f6;
105
- font-family: Arial, sans-serif;
106
- }
107
-
108
- .gradio-interface {
109
- padding: 2rem;
110
- }
111
-
112
- .gradio-interface-header-logo img {
113
- height: 3rem;
114
- margin-right: 1rem;
115
- }
116
-
117
- .gradio-interface-header-title {
118
- font-size: 2rem;
119
- font-weight: bold;
120
- margin: 0;
121
- }
122
-
123
- .gradio-interface-inputs label {
124
- font-weight: bold;
125
- }
126
-
127
- .gradio-interface-inputs gr-input input[type="text"], .gradio-interface-inputs gr-output textarea {
128
- border: 1px solid #ccc;
129
- border-radius: 0.25rem;
130
- padding: 0.5rem;
131
- font-size: 1rem;
132
- width: 100%;
133
- margin-bottom: 1rem;
134
- resize: none;
135
- height: 6rem;
136
- }
137
-
138
- .gradio-interface-outputs gr-output div {
139
- border: 1px solid #ccc;
140
- border-radius: 0.25rem;
141
- padding: 0.5rem;
142
- font-size: 1rem;
143
- width: 100%;
144
- margin-bottom: 1rem;
145
- min-height: 6rem;
146
- }
147
-
148
- .gradio-interface-footer {
149
- margin-top: 2rem;
150
- }
151
-
152
- .gradio-interface-footer .btn-primary {
153
- background-color: #1abc9c;
154
- border-color: #1abc9c;
155
- color: #ffffff;
156
- }
157
-
158
- .gradio-interface-header-icon {
159
- font-size: 2rem;
160
- margin-right: 1rem;
161
- }
162
-
163
- .gradio-interface-header-icon.emoji-icon {
164
- display: none;
165
- }
166
-
167
- .gradio-interface-header-icon.fa-icon {
168
- display: inline-block;
169
- font-family: 'Font Awesome 5 Free';
170
- font-weight: 900;
171
- }
172
- .gradio-interface-header-icon.fa-icon:before {
173
- content: '\f007';
174
- }
175
- """
176
- demo = gr.Interface(fn=greet, inputs="text", outputs="text", title="text-classification app", css=css,
177
- thumbnail="https://i.imgur.com/5rkKx5A.png",
178
  layout="vertical", description="This is a demo for text classification.")
179
  demo.launch()
180
 
 
99
  # print('类别为:{}'.format(classes[predic[0]]))
100
  return classes[predic[0]]
101
 
102
+
103
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text", title="text-classification app",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  layout="vertical", description="This is a demo for text classification.")
105
  demo.launch()
106