Spaces:
Sleeping
Sleeping
add debug
Browse files
app.py
CHANGED
|
@@ -13,7 +13,16 @@ description = """
|
|
| 13 |
prompt = 'Write a story. In the story, try to use the verb "fight", the noun "king" and the adjective "brave". Possible story:'
|
| 14 |
|
| 15 |
def generate_text(input_prompt=prompt, max_len=200, top_k=10, temp=0.5, top_p=0.95):
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
inputs = [
|
|
@@ -30,4 +39,4 @@ demo = gr.Interface(fn=generate_text, inputs=inputs, outputs=outputs, allow_flag
|
|
| 30 |
|
| 31 |
|
| 32 |
if __name__ == "__main__":
|
| 33 |
-
demo.launch()
|
|
|
|
| 13 |
prompt = 'Write a story. In the story, try to use the verb "fight", the noun "king" and the adjective "brave". Possible story:'
|
| 14 |
|
| 15 |
def generate_text(input_prompt=prompt, max_len=200, top_k=10, temp=0.5, top_p=0.95):
|
| 16 |
+
print('inputs: ')
|
| 17 |
+
print('prompt:', prompt)
|
| 18 |
+
print('max_len:', max_len)
|
| 19 |
+
print('top-k:', top_k)
|
| 20 |
+
print('temp:', temp)
|
| 21 |
+
print('top_p:', top_p)
|
| 22 |
+
response = client.text_generation(input_prompt, do_sample=True, max_new_tokens=max_len, temperature=temp, top_k=top_k)
|
| 23 |
+
print('response:')
|
| 24 |
+
print(response)
|
| 25 |
+
return response
|
| 26 |
|
| 27 |
|
| 28 |
inputs = [
|
|
|
|
| 39 |
|
| 40 |
|
| 41 |
if __name__ == "__main__":
|
| 42 |
+
demo.launch(debug=True)
|