Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from predict import *
|
2 |
from transformers import BloomTokenizerFast, BloomForCausalLM
|
3 |
|
4 |
-
import os
|
5 |
import gradio as gr
|
6 |
|
7 |
model_path = "svjack/bloom-dialogue"
|
@@ -28,6 +33,16 @@ def demo_func(prefix, max_length):
|
|
28 |
"Dialogue Context": l
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
demo = gr.Interface(
|
32 |
fn=demo_func,
|
33 |
inputs=[gr.Text(label = "Prefix"),
|
@@ -36,7 +51,8 @@ demo = gr.Interface(
|
|
36 |
outputs="json",
|
37 |
title=f"Bloom Chinese Dialogue Generator π°πΈ demonstration",
|
38 |
examples=example_sample if example_sample else None,
|
39 |
-
description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Daliy-Dialogue](https://github.com/svjack/Daliy-Dialogue)</h4></b>\n',
|
|
|
40 |
cache_examples = False
|
41 |
)
|
42 |
|
|
|
1 |
+
import os
|
2 |
+
os.system("pip install huggingface_hub")
|
3 |
+
|
4 |
+
from huggingface_hub import space_info
|
5 |
+
|
6 |
from predict import *
|
7 |
from transformers import BloomTokenizerFast, BloomForCausalLM
|
8 |
|
9 |
+
#import os
|
10 |
import gradio as gr
|
11 |
|
12 |
model_path = "svjack/bloom-dialogue"
|
|
|
33 |
"Dialogue Context": l
|
34 |
}
|
35 |
|
36 |
+
markdown_exp_size = "##"
|
37 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
38 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=10"
|
39 |
+
emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
40 |
+
space_cnt = 1
|
41 |
+
task_name = "[---Chinese Dialogue Generator---]"
|
42 |
+
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}"
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
demo = gr.Interface(
|
47 |
fn=demo_func,
|
48 |
inputs=[gr.Text(label = "Prefix"),
|
|
|
51 |
outputs="json",
|
52 |
title=f"Bloom Chinese Dialogue Generator π°πΈ demonstration",
|
53 |
examples=example_sample if example_sample else None,
|
54 |
+
#description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Daliy-Dialogue](https://github.com/svjack/Daliy-Dialogue)</h4></b>\n',
|
55 |
+
description = description,
|
56 |
cache_examples = False
|
57 |
)
|
58 |
|