svjack commited on
Commit
d7b4af4
·
1 Parent(s): 73803f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -1,8 +1,13 @@
 
 
 
 
 
1
  from predict import *
2
  #from reconstructor import *
3
  from transformers import BertTokenizer, GPT2LMHeadModel
4
 
5
- import os
6
  import gradio as gr
7
 
8
  model_path = "svjack/gpt-dialogue"
@@ -27,6 +32,15 @@ def demo_func(prefix, max_length):
27
  "Dialogue Context": l
28
  }
29
 
 
 
 
 
 
 
 
 
 
30
  demo = gr.Interface(
31
  fn=demo_func,
32
  inputs=[gr.Text(label = "Prefix"),
@@ -35,7 +49,8 @@ demo = gr.Interface(
35
  outputs="json",
36
  title=f"GPT Chinese Dialogue Generator 🐰 demonstration",
37
  examples=example_sample if example_sample else None,
38
- description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Daliy-Dialogue](https://github.com/svjack/Daliy-Dialogue)</h4></b>\n',
 
39
  cache_examples = False
40
  )
41
 
 
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 reconstructor import *
8
  from transformers import BertTokenizer, GPT2LMHeadModel
9
 
10
+ #import os
11
  import gradio as gr
12
 
13
  model_path = "svjack/gpt-dialogue"
 
32
  "Dialogue Context": l
33
  }
34
 
35
+ markdown_exp_size = "##"
36
+ lora_repo = "svjack/chatglm3-few-shot"
37
+ lora_repo_link = "svjack/chatglm3-few-shot/?input_list_index=10"
38
+ emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
39
+ space_cnt = 1
40
+ task_name = "[---Chinese Dialogue Generator---]"
41
+ 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}"
42
+
43
+
44
  demo = gr.Interface(
45
  fn=demo_func,
46
  inputs=[gr.Text(label = "Prefix"),
 
49
  outputs="json",
50
  title=f"GPT Chinese Dialogue Generator 🐰 demonstration",
51
  examples=example_sample if example_sample else None,
52
+ #description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Daliy-Dialogue](https://github.com/svjack/Daliy-Dialogue)</h4></b>\n',
53
+ description = description,
54
  cache_examples = False
55
  )
56