Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from summary_reverse_pred_eng_native import *
|
2 |
import gradio as gr
|
3 |
-
import os
|
4 |
|
5 |
#text0 = "飓风格特是1993年9月在墨西哥和整个中美洲引发严重洪灾的大规模热带气旋,源于9月14日西南加勒比海上空一股东风波。次日从尼加拉瓜登岸,经过洪都拉斯后于9月17日在洪都拉斯湾再次达到热带风暴标准,但次日进入伯利兹上空后就减弱成热带低气压。穿过尤卡坦半岛后,在9月20日强化成二级飓风,从韦拉克鲁斯州的图斯潘附近登陆墨西哥。9月21日从纳亚里特州进入太平洋时已降级成热带低气压,最终于5天后在开放水域上空消散。"
|
6 |
#text1 = "珊瑚坝是长江中的一处河漫滩,位于长江重庆市渝中区区段主航道左侧[1],靠近渝中半岛,原分属重庆市市中区菜园坝街道和石板坡街道[2],现属渝中区菜园坝街道石板坡社区[3],是长江上游缓冲地段自然冲积沙洲,略呈纺锤形[4]或椭圆形,长约1800米,宽约600米,坝上遍布鹅卵石和水草。每年夏季洪水时均被淹没,其余时间常露水面,枯水期则与长江左岸相连[5]。"
|
@@ -19,6 +24,16 @@ def demo_func(prefix, do_sample):
|
|
19 |
"Dialogue Context": l
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
demo = gr.Interface(
|
23 |
fn=demo_func,
|
24 |
inputs=[gr.Text(label = "Context"),
|
@@ -26,7 +41,8 @@ demo = gr.Interface(
|
|
26 |
],
|
27 |
outputs="json",
|
28 |
title=f"English Context Dialogue Generator 🦅 demonstration",
|
29 |
-
|
|
|
30 |
examples=example_sample if example_sample else None,
|
31 |
cache_examples = False
|
32 |
)
|
|
|
1 |
+
import os
|
2 |
+
os.system("pip install huggingface_hub")
|
3 |
+
|
4 |
+
from huggingface_hub import space_info
|
5 |
+
|
6 |
from summary_reverse_pred_eng_native import *
|
7 |
import gradio as gr
|
8 |
+
#import os
|
9 |
|
10 |
#text0 = "飓风格特是1993年9月在墨西哥和整个中美洲引发严重洪灾的大规模热带气旋,源于9月14日西南加勒比海上空一股东风波。次日从尼加拉瓜登岸,经过洪都拉斯后于9月17日在洪都拉斯湾再次达到热带风暴标准,但次日进入伯利兹上空后就减弱成热带低气压。穿过尤卡坦半岛后,在9月20日强化成二级飓风,从韦拉克鲁斯州的图斯潘附近登陆墨西哥。9月21日从纳亚里特州进入太平洋时已降级成热带低气压,最终于5天后在开放水域上空消散。"
|
11 |
#text1 = "珊瑚坝是长江中的一处河漫滩,位于长江重庆市渝中区区段主航道左侧[1],靠近渝中半岛,原分属重庆市市中区菜园坝街道和石板坡街道[2],现属渝中区菜园坝街道石板坡社区[3],是长江上游缓冲地段自然冲积沙洲,略呈纺锤形[4]或椭圆形,长约1800米,宽约600米,坝上遍布鹅卵石和水草。每年夏季洪水时均被淹没,其余时间常露水面,枯水期则与长江左岸相连[5]。"
|
|
|
24 |
"Dialogue Context": l
|
25 |
}
|
26 |
|
27 |
+
markdown_exp_size = "##"
|
28 |
+
lora_repo = "svjack/chatglm3-few-shot"
|
29 |
+
lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=8"
|
30 |
+
emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
|
31 |
+
space_cnt = 1
|
32 |
+
task_name = "[---English Context Dialogue Generator---]"
|
33 |
+
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}"
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
demo = gr.Interface(
|
38 |
fn=demo_func,
|
39 |
inputs=[gr.Text(label = "Context"),
|
|
|
41 |
],
|
42 |
outputs="json",
|
43 |
title=f"English Context Dialogue Generator 🦅 demonstration",
|
44 |
+
#description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Context2Dialogue](https://github.com/svjack/Context2Dialogue)</h4></b>\n',
|
45 |
+
description = description,
|
46 |
examples=example_sample if example_sample else None,
|
47 |
cache_examples = False
|
48 |
)
|