samim commited on
Commit
b862120
·
1 Parent(s): 90da03b
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -8,19 +8,15 @@ HF_TOKEN = os.environ["HF_TOKEN"]
8
  headers = {"Authorization": f"Bearer {HF_TOKEN}"}
9
 
10
  def text_generate(prompt):
11
-
12
  print(f"*****Inside TEXT_generate - Prompt is :{prompt}")
13
- # print(f"length of input_prompt is {len(input_prompt)}")
14
  print(f"length of prompt is {len(prompt)}")
15
- # if len(prompt) == 0:
16
- # prompt = input_prompt
17
 
18
  json_ = {"inputs": prompt,
19
  "parameters":
20
  {
21
  "top_p": 0.9,
22
  "temperature": 1.1,
23
- "max_new_tokens": 250,
24
  "return_full_text": True,
25
  "do_sample":True,
26
  },
@@ -55,15 +51,12 @@ with demo:
55
  """Exploration of the capabilities of the [BigScienceW Bloom](https://twitter.com/BigscienceW) large language model. Currently, due to size-limits on Prompt and Token generation, we are only able to feed very limited-length text as Prompt and are getting very few tokens generated in-turn. This makes it difficult to keep a tab on theme of text generation. This Space is created by [Samim](https://samim.io) for research and fun"""
56
  )
57
  with gr.Row():
58
- # example_prompt = gr.Radio( ["Once upon a time in a land far away"], label= "Choose a sample Prompt")
59
- #with gr.Column:
60
  input_prompt = gr.Textbox(label="Write text to prompt the model", value="Once upon a time in a land far away", lines=6)
61
 
62
  with gr.Row():
63
  generated_txt = gr.Textbox(lines=3)
64
 
65
  b1 = gr.Button("Generate Text")
66
- # b1.click(text_generate,inputs=[example_prompt, input_prompt], outputs=generated_txt)
67
  b1.click(text_generate,inputs=[input_prompt], outputs=generated_txt)
68
 
69
  with gr.Row():
 
8
  headers = {"Authorization": f"Bearer {HF_TOKEN}"}
9
 
10
  def text_generate(prompt):
 
11
  print(f"*****Inside TEXT_generate - Prompt is :{prompt}")
 
12
  print(f"length of prompt is {len(prompt)}")
 
 
13
 
14
  json_ = {"inputs": prompt,
15
  "parameters":
16
  {
17
  "top_p": 0.9,
18
  "temperature": 1.1,
19
+ "max_new_tokens": 350,
20
  "return_full_text": True,
21
  "do_sample":True,
22
  },
 
51
  """Exploration of the capabilities of the [BigScienceW Bloom](https://twitter.com/BigscienceW) large language model. Currently, due to size-limits on Prompt and Token generation, we are only able to feed very limited-length text as Prompt and are getting very few tokens generated in-turn. This makes it difficult to keep a tab on theme of text generation. This Space is created by [Samim](https://samim.io) for research and fun"""
52
  )
53
  with gr.Row():
 
 
54
  input_prompt = gr.Textbox(label="Write text to prompt the model", value="Once upon a time in a land far away", lines=6)
55
 
56
  with gr.Row():
57
  generated_txt = gr.Textbox(lines=3)
58
 
59
  b1 = gr.Button("Generate Text")
 
60
  b1.click(text_generate,inputs=[input_prompt], outputs=generated_txt)
61
 
62
  with gr.Row():