lvwerra HF staff commited on
Commit
cd7fced
1 Parent(s): 83b80a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -32
app.py CHANGED
@@ -18,6 +18,35 @@ FIM_SUFFIX = "<fim_suffix>"
18
 
19
  FIM_INDICATOR = "<FILL_HERE>"
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  theme = gr.themes.Monochrome(
22
  primary_hue="indigo",
23
  secondary_hue="blue",
@@ -93,44 +122,20 @@ with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
93
  """\
94
  # BigCode - Playground
95
 
96
- _Note:_ this is an internal playground - please do not share. The deployment can also change and thus the space not work as we continue development.
97
-
98
- ## Model formats
99
 
100
- ### Prefixes
101
- Any combination of the three:
102
-
103
- ```
104
- <reponame>REPONAME<filename>FILENAME<gh_stars>STARS\nCode<eos>
105
- ```
106
- Stars be: 0, 1-10, 10-100, 100-1000, 1000+
107
-
108
- ### Commits
109
-
110
- ```
111
- <commit_before>code<commit_msg>text<commit_after>code<|endoftext|>
112
- ```
113
-
114
- ### Jupyter structure
115
-
116
- ```
117
- <start_jupyter><jupyter_text>text<jupyter_code>code<jupyter_output>output<jupyter_text>
118
- ```
119
-
120
- ### Fill-in-the-middle
121
-
122
- ```
123
- code before<FILL_HERE>code after
124
- ```
125
- """
126
  )
127
  with gr.Row():
128
  with gr.Column(scale=3):
129
  instruction = gr.Textbox(placeholder="Enter your prompt here", label="Prompt", elem_id="q-input")
130
-
131
  with gr.Box():
132
  output = gr.Code(elem_id="q-output")
133
- submit = gr.Button("Generate", variant="primary")
 
 
 
134
  gr.Examples(
135
  examples=examples,
136
  inputs=[instruction],
@@ -180,5 +185,5 @@ code before<FILL_HERE>code after
180
 
181
  submit.click(generate, inputs=[instruction, temperature, max_new_tokens, top_p, repetition_penalty], outputs=[output])
182
  instruction.submit(generate, inputs=[instruction, temperature, max_new_tokens, top_p, repetition_penalty], outputs=[output])
183
-
184
  demo.queue(concurrency_count=16).launch(debug=True)
 
18
 
19
  FIM_INDICATOR = "<FILL_HERE>"
20
 
21
+ FORMATS = """## Model formats
22
+
23
+ ### Prefixes
24
+ Any combination of the three:
25
+
26
+ ```
27
+ <reponame>REPONAME<filename>FILENAME<gh_stars>STARS\nCode<eos>
28
+ ```
29
+ Stars be: 0, 1-10, 10-100, 100-1000, 1000+
30
+
31
+ ### Commits
32
+
33
+ ```
34
+ <commit_before>code<commit_msg>text<commit_after>code<|endoftext|>
35
+ ```
36
+
37
+ ### Jupyter structure
38
+
39
+ ```
40
+ <start_jupyter><jupyter_text>text<jupyter_code>code<jupyter_output>output<jupyter_text>
41
+ ```
42
+
43
+ ### Fill-in-the-middle
44
+
45
+ ```
46
+ code before<FILL_HERE>code after
47
+ ```
48
+ """
49
+
50
  theme = gr.themes.Monochrome(
51
  primary_hue="indigo",
52
  secondary_hue="blue",
 
122
  """\
123
  # BigCode - Playground
124
 
125
+ _Note:_ this is an internal playground - please do not share. The deployment can also change and thus the space not work as we continue development.\
126
+ """
 
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  )
129
  with gr.Row():
130
  with gr.Column(scale=3):
131
  instruction = gr.Textbox(placeholder="Enter your prompt here", label="Prompt", elem_id="q-input")
132
+ submit = gr.Button("Generate", variant="primary")
133
  with gr.Box():
134
  output = gr.Code(elem_id="q-output")
135
+ with gr.Group(elem_id="share-btn-container"):
136
+ community_icon = gr.HTML(community_icon_html, visible=True)
137
+ loading_icon = gr.HTML(loading_icon_html, visible=True)
138
+ share_button = gr.Button("Share to community", elem_id="share-btn", visible=True)
139
  gr.Examples(
140
  examples=examples,
141
  inputs=[instruction],
 
185
 
186
  submit.click(generate, inputs=[instruction, temperature, max_new_tokens, top_p, repetition_penalty], outputs=[output])
187
  instruction.submit(generate, inputs=[instruction, temperature, max_new_tokens, top_p, repetition_penalty], outputs=[output])
188
+ share_button.click(None, [], [], _js=share_js)
189
  demo.queue(concurrency_count=16).launch(debug=True)