Spaces:
Runtime error
Runtime error
fix str
Browse files
app.py
CHANGED
@@ -184,15 +184,15 @@ with gr.Blocks() as demo:
|
|
184 |
Note: Providing more text to the `Text` box can make the prediction more accurate!
|
185 |
"""
|
186 |
)
|
187 |
-
a1 = gr.Textbox(
|
188 |
-
|
189 |
-
\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored.
|
190 |
-
This means that the information is transformed into a code that is difficult for anyone to read without the right key.
|
191 |
-
"""
|
192 |
)
|
193 |
button1 = gr.Button("🤖 Predict!")
|
|
|
194 |
label1_gltr = gr.Textbox(lines=1, label='GLTR Predicted Label 🎃')
|
195 |
score1_gltr = gr.Textbox(lines=1, label='GLTR Probability')
|
|
|
196 |
label1_ppl = gr.Textbox(lines=1, label='PPL Predicted Label 🎃')
|
197 |
score1_ppl = gr.Textbox(lines=1, label='PPL Probability')
|
198 |
|
@@ -202,15 +202,15 @@ with gr.Blocks() as demo:
|
|
202 |
注意: 在`文本`栏中输入更多的文本,可以让预测更准确哦!
|
203 |
"""
|
204 |
)
|
205 |
-
a2 = gr.Textbox(
|
206 |
-
|
207 |
-
|
208 |
-
这个问题也是我们课题组这两年在探索的学术问题之一。
|
209 |
-
"""
|
210 |
)
|
211 |
button2 = gr.Button("🤖 预测!")
|
212 |
-
|
213 |
-
|
|
|
|
|
214 |
label2_ppl = gr.Textbox(lines=1, label='PPL 预测结果 🎃')
|
215 |
score2_ppl = gr.Textbox(lines=1, label='PPL 模型概率')
|
216 |
|
@@ -218,14 +218,9 @@ with gr.Blocks() as demo:
|
|
218 |
button2.click(predict_zh, inputs=[a2], outputs=[label2_gltr, score2_gltr, label2_ppl, score2_ppl])
|
219 |
|
220 |
# Page Count
|
221 |
-
gr.Markdown(
|
222 |
-
|
223 |
-
|
224 |
-
<a href='https://clustrmaps.com/site/1bsdd' title='Visit tracker'>
|
225 |
-
< img src='//clustrmaps.com/map_v2.png?cl=080808&w=a&t=tt&d=NvxUHBTxY0ECXEuebgz8Ym8ynpVtduq59ENXoQpFh74&co=ffffff&ct=808080'/>
|
226 |
-
</a>
|
227 |
-
</center>
|
228 |
-
"""
|
229 |
-
)
|
230 |
|
231 |
demo.launch()
|
|
|
|
184 |
Note: Providing more text to the `Text` box can make the prediction more accurate!
|
185 |
"""
|
186 |
)
|
187 |
+
a1 = gr.Textbox(
|
188 |
+
lines=5, label='Text',
|
189 |
+
value="There are a few things that can help protect your credit card information from being misused when you give it to a restaurant or any other business:\n\nEncryption: Many businesses use encryption to protect your credit card information when it is being transmitted or stored. This means that the information is transformed into a code that is difficult for anyone to read without the right key."
|
|
|
|
|
190 |
)
|
191 |
button1 = gr.Button("🤖 Predict!")
|
192 |
+
gr.Markdown("GLTR")
|
193 |
label1_gltr = gr.Textbox(lines=1, label='GLTR Predicted Label 🎃')
|
194 |
score1_gltr = gr.Textbox(lines=1, label='GLTR Probability')
|
195 |
+
gr.Markdown("PPL")
|
196 |
label1_ppl = gr.Textbox(lines=1, label='PPL Predicted Label 🎃')
|
197 |
score1_ppl = gr.Textbox(lines=1, label='PPL Probability')
|
198 |
|
|
|
202 |
注意: 在`文本`栏中输入更多的文本,可以让预测更准确哦!
|
203 |
"""
|
204 |
)
|
205 |
+
a2 = gr.Textbox(
|
206 |
+
lines=5, label='文本',
|
207 |
+
value="对于OpenAI大力出奇迹的工作,自然每个人都有自己的看点。我自己最欣赏的地方是ChatGPT如何解决 “AI校正(Alignment)“这个问题。这个问题也是我们课题组这两年在探索的学术问题之一。"
|
|
|
|
|
208 |
)
|
209 |
button2 = gr.Button("🤖 预测!")
|
210 |
+
gr.Markdown("GLTR")
|
211 |
+
label2_gltr = gr.Textbox(lines=1, label='预测结果 🎃')
|
212 |
+
score2_gltr = gr.Textbox(lines=1, label='模型概率')
|
213 |
+
gr.Markdown("PPL")
|
214 |
label2_ppl = gr.Textbox(lines=1, label='PPL 预测结果 🎃')
|
215 |
score2_ppl = gr.Textbox(lines=1, label='PPL 模型概率')
|
216 |
|
|
|
218 |
button2.click(predict_zh, inputs=[a2], outputs=[label2_gltr, score2_gltr, label2_ppl, score2_ppl])
|
219 |
|
220 |
# Page Count
|
221 |
+
gr.Markdown("""
|
222 |
+
<center><a href="https://clustrmaps.com/site/1bsdd" title="Visit tracker">< img src="//clustrmaps.com/map_v2.png?cl=080808&w=a&t=tt&d=NvxUHBTxY0ECXEuebgz8Ym8ynpVtduq59ENXoQpFh74&co=ffffff&ct=808080"/></a></center>
|
223 |
+
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
|
225 |
demo.launch()
|
226 |
+
# To create a public link, set `share=True` in `launch()`.
|