Spaces:
Runtime error
Runtime error
efengx
commited on
Commit
·
75fe05c
1
Parent(s):
94c8109
fix: update
Browse files- app.py +4 -3
- fengx_launch.ipynb +35 -8
app.py
CHANGED
@@ -15,14 +15,13 @@ pipe=pipeline(
|
|
15 |
if 'type' not in st.session_state:
|
16 |
st.session_state.type=""
|
17 |
|
18 |
-
if '
|
19 |
st.session_state.article=""
|
20 |
|
21 |
if 'result' not in st.session_state:
|
22 |
st.session_state.result=""
|
23 |
|
24 |
def form_article_click():
|
25 |
-
|
26 |
if st.session_state.article_key == "":
|
27 |
st.warning("Need to enter content")
|
28 |
else:
|
@@ -39,6 +38,8 @@ def form_article_click():
|
|
39 |
st.session_state.type="AI writing"
|
40 |
st.session_state.result=result
|
41 |
|
|
|
|
|
42 |
st.title("AI write or Human write v2")
|
43 |
|
44 |
col1, col2 = st.columns(2)
|
@@ -53,7 +54,7 @@ with col1:
|
|
53 |
key='article_key'
|
54 |
)
|
55 |
# 提交按钮
|
56 |
-
|
57 |
|
58 |
with col2:
|
59 |
st.header("output")
|
|
|
15 |
if 'type' not in st.session_state:
|
16 |
st.session_state.type=""
|
17 |
|
18 |
+
if 'article_key' not in st.session_state:
|
19 |
st.session_state.article=""
|
20 |
|
21 |
if 'result' not in st.session_state:
|
22 |
st.session_state.result=""
|
23 |
|
24 |
def form_article_click():
|
|
|
25 |
if st.session_state.article_key == "":
|
26 |
st.warning("Need to enter content")
|
27 |
else:
|
|
|
38 |
st.session_state.type="AI writing"
|
39 |
st.session_state.result=result
|
40 |
|
41 |
+
|
42 |
+
st.set_page_config(layout="wide")
|
43 |
st.title("AI write or Human write v2")
|
44 |
|
45 |
col1, col2 = st.columns(2)
|
|
|
54 |
key='article_key'
|
55 |
)
|
56 |
# 提交按钮
|
57 |
+
st.form_submit_button(label='submit', on_click=form_article_click)
|
58 |
|
59 |
with col2:
|
60 |
st.header("output")
|
fengx_launch.ipynb
CHANGED
@@ -23,9 +23,36 @@
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
-
"execution_count":
|
27 |
"metadata": {},
|
28 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
"source": [
|
30 |
"# 任务:运行本地debug\n",
|
31 |
"!streamlit run app.py"
|
@@ -33,21 +60,21 @@
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
-
"execution_count":
|
37 |
"metadata": {},
|
38 |
"outputs": [
|
39 |
{
|
40 |
"name": "stdout",
|
41 |
"output_type": "stream",
|
42 |
"text": [
|
43 |
-
"Enumerating objects:
|
44 |
-
"Counting objects: 100% (
|
45 |
"Delta compression using up to 8 threads\n",
|
46 |
"Compressing objects: 100% (4/4), done.\n",
|
47 |
-
"Writing objects: 100% (4/4),
|
48 |
-
"Total 4 (delta
|
49 |
"To https://huggingface.co/spaces/rjx/rjxai-ahs-en-v1\n",
|
50 |
-
"
|
51 |
]
|
52 |
}
|
53 |
],
|
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
+
"execution_count": 2,
|
27 |
"metadata": {},
|
28 |
+
"outputs": [
|
29 |
+
{
|
30 |
+
"name": "stdout",
|
31 |
+
"output_type": "stream",
|
32 |
+
"text": [
|
33 |
+
"\u001b[0m\n",
|
34 |
+
"\u001b[34m\u001b[1m You can now view your Streamlit app in your browser.\u001b[0m\n",
|
35 |
+
"\u001b[0m\n",
|
36 |
+
"\u001b[34m Local URL: \u001b[0m\u001b[1mhttp://localhost:8501\u001b[0m\n",
|
37 |
+
"\u001b[34m Network URL: \u001b[0m\u001b[1mhttp://198.18.0.1:8501\u001b[0m\n",
|
38 |
+
"\u001b[0m\n",
|
39 |
+
"\u001b[34m\u001b[1m For better performance, install the Watchdog module:\u001b[0m\n",
|
40 |
+
"\n",
|
41 |
+
" $ xcode-select --install\n",
|
42 |
+
" $ pip install watchdog\n",
|
43 |
+
" \u001b[0m\n",
|
44 |
+
"Downloading (…)lve/main/config.json: 100%|██| 1.03k/1.03k [00:00<00:00, 157kB/s]\n",
|
45 |
+
"Downloading pytorch_model.bin: 100%|███████| 1.25G/1.25G [02:28<00:00, 8.41MB/s]\n",
|
46 |
+
"Downloading (…)okenizer_config.json: 100%|█████| 684/684 [00:00<00:00, 93.0kB/s]\n",
|
47 |
+
"Downloading tokenizer.json: 100%|██████████| 17.1M/17.1M [00:03<00:00, 5.11MB/s]\n",
|
48 |
+
"Downloading (…)cial_tokens_map.json: 100%|██████| 280/280 [00:00<00:00, 116kB/s]\n",
|
49 |
+
"hello world\n",
|
50 |
+
"[{'label': 1, 'score': 0.9999076128005981}]\n",
|
51 |
+
"^C\n",
|
52 |
+
"\u001b[34m Stopping...\u001b[0m\n"
|
53 |
+
]
|
54 |
+
}
|
55 |
+
],
|
56 |
"source": [
|
57 |
"# 任务:运行本地debug\n",
|
58 |
"!streamlit run app.py"
|
|
|
60 |
},
|
61 |
{
|
62 |
"cell_type": "code",
|
63 |
+
"execution_count": 3,
|
64 |
"metadata": {},
|
65 |
"outputs": [
|
66 |
{
|
67 |
"name": "stdout",
|
68 |
"output_type": "stream",
|
69 |
"text": [
|
70 |
+
"Enumerating objects: 7, done.\n",
|
71 |
+
"Counting objects: 100% (7/7), done.\n",
|
72 |
"Delta compression using up to 8 threads\n",
|
73 |
"Compressing objects: 100% (4/4), done.\n",
|
74 |
+
"Writing objects: 100% (4/4), 592 bytes | 592.00 KiB/s, done.\n",
|
75 |
+
"Total 4 (delta 3), reused 0 (delta 0), pack-reused 0\n",
|
76 |
"To https://huggingface.co/spaces/rjx/rjxai-ahs-en-v1\n",
|
77 |
+
" 48d3495..94c8109 main -> main\n"
|
78 |
]
|
79 |
}
|
80 |
],
|