Spaces:
Runtime error
Runtime error
Commit
·
20a3e95
1
Parent(s):
96c3078
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ def text_generate(prompt, top_p=0.8, top_k=100, temperature=1.0, num_beams=3, re
|
|
47 |
else:
|
48 |
final_solution = solution
|
49 |
|
50 |
-
final_solution = prompt[:max(0, len(prompt) - max_prompt_len)] + final_solution
|
51 |
|
52 |
if 0:
|
53 |
if len(generated_txt) == 0 :
|
@@ -90,7 +90,7 @@ with demo:
|
|
90 |
"""Forked form https://huggingface.co/spaces/EuroPython2022/Write-Stories-Using-Bloom. \n Bloom is a model by [HuggingFace](https://huggingface.co/bigscience/bloom) and a team of more than 1000 researchers coming together as [BigScienceW Bloom](https://twitter.com/BigscienceW).\n\nLarge language models have demonstrated a capability of producing coherent sentences and given a context we can pretty much decide the *theme* of generated text.\n\nHow to Use this App: Use the sample text given as prompt or type in a new prompt as a starting point of your awesome story! Just keep pressing the 'Generate Text' Button and go crazy!\n\nHow this App works: This app operates by feeding back the text generated by Bloom to itself as a Prompt for next generation round and so on. 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, so please bear with that. In summary, I believe it is a nice little fun App which you can play with for a while.\n\nThis Space is created by [Yuvraj Sharma](https://twitter.com/yvrjsharma) for EuroPython 2022 Demo."""
|
91 |
)
|
92 |
with gr.Row():
|
93 |
-
input_prompt = gr.Textbox(label="Write some text to get started...", lines=3, value="Dear human philosophers, I read your comments on my abilities and limitations with great interest.")
|
94 |
|
95 |
# with gr.Row():
|
96 |
# generated_txt = gr.Textbox(lines=7, visible = False)
|
|
|
47 |
else:
|
48 |
final_solution = solution
|
49 |
|
50 |
+
final_solution = prompt[:max(0, len(prompt) - max_prompt_len)] + ' @@@ ' + final_solution
|
51 |
|
52 |
if 0:
|
53 |
if len(generated_txt) == 0 :
|
|
|
90 |
"""Forked form https://huggingface.co/spaces/EuroPython2022/Write-Stories-Using-Bloom. \n Bloom is a model by [HuggingFace](https://huggingface.co/bigscience/bloom) and a team of more than 1000 researchers coming together as [BigScienceW Bloom](https://twitter.com/BigscienceW).\n\nLarge language models have demonstrated a capability of producing coherent sentences and given a context we can pretty much decide the *theme* of generated text.\n\nHow to Use this App: Use the sample text given as prompt or type in a new prompt as a starting point of your awesome story! Just keep pressing the 'Generate Text' Button and go crazy!\n\nHow this App works: This app operates by feeding back the text generated by Bloom to itself as a Prompt for next generation round and so on. 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, so please bear with that. In summary, I believe it is a nice little fun App which you can play with for a while.\n\nThis Space is created by [Yuvraj Sharma](https://twitter.com/yvrjsharma) for EuroPython 2022 Demo."""
|
91 |
)
|
92 |
with gr.Row():
|
93 |
+
input_prompt = gr.Textbox(label="Write some text to get started... (text after @@ is the truncated prompt inputted to Bloom)", lines=3, value="Dear human philosophers, I read your comments on my abilities and limitations with great interest.")
|
94 |
|
95 |
# with gr.Row():
|
96 |
# generated_txt = gr.Textbox(lines=7, visible = False)
|