svjack commited on
Commit
e613db2
β€’
1 Parent(s): dd5be04

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
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-daliy-dialogue-english"
@@ -28,6 +33,15 @@ 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 +50,8 @@ demo = gr.Interface(
36
  outputs="json",
37
  title=f"Bloom English Daliy 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-daliy-dialogue-english"
 
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=11"
39
+ emoji_info = space_info(lora_repo).__dict__["cardData"]["emoji"]
40
+ space_cnt = 1
41
+ task_name = "[---English 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
  demo = gr.Interface(
46
  fn=demo_func,
47
  inputs=[gr.Text(label = "Prefix"),
 
50
  outputs="json",
51
  title=f"Bloom English Daliy Dialogue Generator πŸ¦…πŸŒΈ demonstration",
52
  examples=example_sample if example_sample else None,
53
+ #description = 'This _example_ was **drive** from <br/><b><h4>[https://github.com/svjack/Daliy-Dialogue](https://github.com/svjack/Daliy-Dialogue)</h4></b>\n',
54
+ description = description,
55
  cache_examples = False
56
  )
57