Upload folder using huggingface_hub
Browse files- demo.py +11 -2
- flagged/log.csv +1 -2
demo.py
CHANGED
@@ -1,9 +1,18 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
4 |
# 创建一个pipeline对象,并指定使用GPU(设备编号为0)
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
# 使用该pipeline创建Gradio接口并启动
|
|
|
8 |
interface = gr.Interface.from_pipeline(qa_pipeline)
|
9 |
-
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
|
6 |
+
|
7 |
# 创建一个pipeline对象,并指定使用GPU(设备编号为0)
|
8 |
+
|
9 |
+
qa_pipeline = pipeline("text-classification", model="uer/roberta-base-finetuned-dianping-chinese", device=0)
|
10 |
+
|
11 |
+
|
12 |
|
13 |
# 使用该pipeline创建Gradio接口并启动
|
14 |
+
|
15 |
interface = gr.Interface.from_pipeline(qa_pipeline)
|
16 |
+
|
17 |
+
interface.launch(share=True, server_name="0.0.0.0", server_port=7790)
|
18 |
+
|
flagged/log.csv
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
Context,Question,Answer,Score,flag,username,timestamp
|
2 |
-
|
3 |
-
我是人,我是?,,"{""label"": null, ""confidences"": null}",,,2024-08-07 17:47:36.671893
|
|
|
1 |
Context,Question,Answer,Score,flag,username,timestamp
|
2 |
+
我是人,我是?,,"{""label"": null, ""confidences"": null}",,,2024-08-08 10:26:02.106761
|
|