rootacess commited on
Commit
82b4c6c
1 Parent(s): 58332ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -4
app.py CHANGED
@@ -58,8 +58,8 @@ def generate(query:str, temperature=0.9, max_new_tokens=256, top_p=0.95, repetit
58
  return output
59
 
60
 
61
- def process_example(args):
62
- for x in generate(args):
63
  pass
64
  return x
65
 
@@ -88,7 +88,19 @@ disclaimer = """⚠️<b>Any use or sharing of this demo constitues your accepta
88
  <br>**Intended Use**: this app and its [supporting model](https://huggingface.co/bigcode) are provided for demonstration purposes; not to serve as replacement for human expertise. For more details on the model's limitations in terms of factuality and biases, see the [model card.](https://huggingface.co/bigcode)"""
89
 
90
 
91
- examples = [['Please write a function in Python that performs bubble sort.']]
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
 
94
  with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
@@ -151,7 +163,7 @@ with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
151
  gr.Markdown(disclaimer)
152
  gr.Examples(
153
  examples=examples,
154
- inputs=[instruction],
155
  cache_examples=False,
156
  fn=process_example,
157
  outputs=[output],
 
58
  return output
59
 
60
 
61
+ def process_example(**krwags):
62
+ for x in generate(**krwags):
63
  pass
64
  return x
65
 
 
88
  <br>**Intended Use**: this app and its [supporting model](https://huggingface.co/bigcode) are provided for demonstration purposes; not to serve as replacement for human expertise. For more details on the model's limitations in terms of factuality and biases, see the [model card.](https://huggingface.co/bigcode)"""
89
 
90
 
91
+ examples = [
92
+ ['Please write a function in Python that performs bubble sort.', 256],
93
+ ['''Explain the following piece of code
94
+ def count_unique(s):
95
+ s = s.lower()
96
+ s_split = list(s)
97
+ valid_chars = [char for char in s_split if char.isalpha() or char == " "]
98
+ valid_sentence = "".join(valid_chars)
99
+ uniques = set(valid_sentence.split(" "))
100
+ return len(uniques)''', 512],
101
+ ['Write an efficient Python function that takes a given text and returns its Morse code equivalent without using any third party library', 512],
102
+ ['Write a html and css code to render a clock', 8000],
103
+ ]
104
 
105
 
106
  with gr.Blocks(theme=theme, analytics_enabled=False, css=css) as demo:
 
163
  gr.Markdown(disclaimer)
164
  gr.Examples(
165
  examples=examples,
166
+ inputs=[instruction, max_new_tokens],
167
  cache_examples=False,
168
  fn=process_example,
169
  outputs=[output],