Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,10 @@ out = subprocess.check_output("pip --version")
|
|
19 |
print(out.decode())
|
20 |
'''
|
21 |
|
|
|
|
|
|
|
|
|
22 |
import sys
|
23 |
import re
|
24 |
|
@@ -66,12 +70,24 @@ def demo_func(question):
|
|
66 |
"Question words": ask_spans
|
67 |
}
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
demo = gr.Interface(
|
71 |
fn=demo_func,
|
72 |
inputs="text",
|
73 |
outputs="json",
|
74 |
title=f"Chinese Question Words extractor 🐱 demonstration",
|
|
|
75 |
examples=example_sample if example_sample else None,
|
76 |
cache_examples = False
|
77 |
)
|
|
|
19 |
print(out.decode())
|
20 |
'''
|
21 |
|
22 |
+
os.system("pip install huggingface_hub")
|
23 |
+
|
24 |
+
from huggingface_hub import space_info
|
25 |
+
|
26 |
import sys
|
27 |
import re
|
28 |
|
|
|
70 |
"Question words": ask_spans
|
71 |
}
|
72 |
|
73 |
+
markdown_exp_size = "#"
|
74 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
75 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=2"
|
76 |
+
emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
77 |
+
space_cnt = 1
|
78 |
+
task_name = "[---Chinese Question Words extractor---]"
|
79 |
+
description = gr.Markdown(
|
80 |
+
value=f"{markdown_exp_size} {space_cnt}. Check {task_name} few shot prompt in this repo by visit ChatGLM3 Few Shot space repo (click submit to activate) : [{lora_repo_link}](https://huggingface.co/spaces/{lora_repo_link}) {emoji_info}",
|
81 |
+
visible=True,
|
82 |
+
elem_id="selected_space",
|
83 |
+
)
|
84 |
|
85 |
demo = gr.Interface(
|
86 |
fn=demo_func,
|
87 |
inputs="text",
|
88 |
outputs="json",
|
89 |
title=f"Chinese Question Words extractor 🐱 demonstration",
|
90 |
+
description = description,
|
91 |
examples=example_sample if example_sample else None,
|
92 |
cache_examples = False
|
93 |
)
|