Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@
|
|
6 |
|
7 |
import logging
|
8 |
import os
|
|
|
|
|
|
|
9 |
import sys
|
10 |
from dataclasses import dataclass, field
|
11 |
from typing import Optional
|
@@ -334,12 +337,21 @@ example_sample = [
|
|
334 |
"美国的通货是什么?",
|
335 |
]
|
336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
demo = gr.Interface(
|
339 |
fn=ner_entity_type_predict_only,
|
340 |
inputs="text",
|
341 |
outputs="json",
|
342 |
title=f"Chinese Question Entity Property decomposition 🌧️ demonstration",
|
|
|
343 |
examples=example_sample if example_sample else None,
|
344 |
cache_examples = False
|
345 |
)
|
|
|
6 |
|
7 |
import logging
|
8 |
import os
|
9 |
+
os.system("pip install huggingface_hub")
|
10 |
+
from huggingface_hub import space_info
|
11 |
+
|
12 |
import sys
|
13 |
from dataclasses import dataclass, field
|
14 |
from typing import Optional
|
|
|
337 |
"美国的通货是什么?",
|
338 |
]
|
339 |
|
340 |
+
markdown_exp_size = "#"
|
341 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
342 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=3"
|
343 |
+
emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
344 |
+
space_cnt = 1
|
345 |
+
task_name = "[---Chinese Question Entity Property decomposition---]"
|
346 |
+
description = 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}"
|
347 |
+
|
348 |
|
349 |
demo = gr.Interface(
|
350 |
fn=ner_entity_type_predict_only,
|
351 |
inputs="text",
|
352 |
outputs="json",
|
353 |
title=f"Chinese Question Entity Property decomposition 🌧️ demonstration",
|
354 |
+
description = description,
|
355 |
examples=example_sample if example_sample else None,
|
356 |
cache_examples = False
|
357 |
)
|