Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
|
|
|
|
|
|
|
|
3 |
from predict import *
|
4 |
|
5 |
from transformers import T5ForConditionalGeneration
|
@@ -44,6 +48,15 @@ def demo_func(event, do_sample):
|
|
44 |
"Output": l
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
demo = gr.Interface(
|
48 |
fn=demo_func,
|
49 |
inputs=[gr.Text(label = "Event"),
|
@@ -51,7 +64,8 @@ demo = gr.Interface(
|
|
51 |
],
|
52 |
outputs="json",
|
53 |
title=f"Chinese Comet Atomic 🐰 demonstration",
|
54 |
-
description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/COMET-ATOMIC-En-Zh](https://github.com/svjack/COMET-ATOMIC-En-Zh)</h4></b>\n',
|
|
|
55 |
examples=example_sample if example_sample else None,
|
56 |
cache_examples = False
|
57 |
)
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
+
os.system("pip install huggingface_hub")
|
4 |
+
|
5 |
+
from huggingface_hub import space_info
|
6 |
+
|
7 |
from predict import *
|
8 |
|
9 |
from transformers import T5ForConditionalGeneration
|
|
|
48 |
"Output": l
|
49 |
}
|
50 |
|
51 |
+
markdown_exp_size = "##"
|
52 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
53 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=5"
|
54 |
+
emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
55 |
+
space_cnt = 1
|
56 |
+
task_name = "[---Chinese Comet Atomic---]"
|
57 |
+
description = f"{markdown_exp_size} {task_name} few shot prompt in ChatGLM3 Few Shot space repo (click submit to activate) : [{lora_repo_link}](https://huggingface.co/spaces/{lora_repo_link}) {emoji_info}"
|
58 |
+
|
59 |
+
|
60 |
demo = gr.Interface(
|
61 |
fn=demo_func,
|
62 |
inputs=[gr.Text(label = "Event"),
|
|
|
64 |
],
|
65 |
outputs="json",
|
66 |
title=f"Chinese Comet Atomic 🐰 demonstration",
|
67 |
+
#description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/COMET-ATOMIC-En-Zh](https://github.com/svjack/COMET-ATOMIC-En-Zh)</h4></b>\n',
|
68 |
+
description = description,
|
69 |
examples=example_sample if example_sample else None,
|
70 |
cache_examples = False
|
71 |
)
|