Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -60,12 +60,12 @@ def text_generate(prompt):
|
|
60 |
{
|
61 |
"top_p": 0.9,
|
62 |
"temperature": 1.1,
|
63 |
-
"max_new_tokens":
|
64 |
"return_full_text": False
|
65 |
}}
|
66 |
response = requests.post(API_URL, headers=headers, json=json_)
|
67 |
-
|
68 |
-
print(f"If there was an error? Reason is : {
|
69 |
#output_tmp = output[0]['generated_text']
|
70 |
#print(f"GPTJ response without splits is: {output_tmp}")
|
71 |
#poem = output[0]['generated_text'].split("\n\n")[0] # +"."
|
@@ -80,7 +80,7 @@ def text_generate(prompt):
|
|
80 |
# poem = output_tmp.split("\n\n")[0] # +"."
|
81 |
#poem = poem.replace('?','')
|
82 |
#print(f"Poem being returned is: {poem}")
|
83 |
-
return response #output_tmp #poem
|
84 |
|
85 |
|
86 |
demo = gr.Blocks()
|
|
|
60 |
{
|
61 |
"top_p": 0.9,
|
62 |
"temperature": 1.1,
|
63 |
+
"max_new_tokens": 300,
|
64 |
"return_full_text": False
|
65 |
}}
|
66 |
response = requests.post(API_URL, headers=headers, json=json_)
|
67 |
+
output = response.json()
|
68 |
+
print(f"If there was an error? Reason is : {output}") #{output}")
|
69 |
#output_tmp = output[0]['generated_text']
|
70 |
#print(f"GPTJ response without splits is: {output_tmp}")
|
71 |
#poem = output[0]['generated_text'].split("\n\n")[0] # +"."
|
|
|
80 |
# poem = output_tmp.split("\n\n")[0] # +"."
|
81 |
#poem = poem.replace('?','')
|
82 |
#print(f"Poem being returned is: {poem}")
|
83 |
+
return output #response #output_tmp #poem
|
84 |
|
85 |
|
86 |
demo = gr.Blocks()
|