|
@ -31,7 +31,7 @@ async def generate_sync( |
|
|
input_data = { |
|
|
input_data = { |
|
|
"input": { |
|
|
"input": { |
|
|
"prompt": prompt, |
|
|
"prompt": prompt, |
|
|
"max_length": max(prompt_num_tokens+max_new_tokens, 2048), |
|
|
"max_length": min(prompt_num_tokens+max_new_tokens, 2048), |
|
|
"temperature": 0.80, |
|
|
"temperature": 0.80, |
|
|
"do_sample": True, |
|
|
"do_sample": True, |
|
|
} |
|
|
} |
|
@ -61,7 +61,7 @@ async def generate_sync( |
|
|
return reply |
|
|
return reply |
|
|
elif status == 'IN_PROGRESS' or status == 'IN_QUEUE': |
|
|
elif status == 'IN_PROGRESS' or status == 'IN_QUEUE': |
|
|
job_id = r_json["id"] |
|
|
job_id = r_json["id"] |
|
|
TIMEOUT = 180 |
|
|
TIMEOUT = 360 |
|
|
DELAY = 5 |
|
|
DELAY = 5 |
|
|
for i in range(TIMEOUT//DELAY): |
|
|
for i in range(TIMEOUT//DELAY): |
|
|
endpoint = "https://api.runpod.ai/v2/pygmalion-6b/status/" + job_id |
|
|
endpoint = "https://api.runpod.ai/v2/pygmalion-6b/status/" + job_id |
|
@ -191,7 +191,7 @@ async def generate_image(input_prompt: str, negative_prompt: str, api_url: str, |
|
|
if status != 'IN_QUEUE': |
|
|
if status != 'IN_QUEUE': |
|
|
raise ValueError(f"RETURN CODE {status}") |
|
|
raise ValueError(f"RETURN CODE {status}") |
|
|
job_id = r_json["id"] |
|
|
job_id = r_json["id"] |
|
|
TIMEOUT = 180 |
|
|
TIMEOUT = 360 |
|
|
DELAY = 5 |
|
|
DELAY = 5 |
|
|
output = None |
|
|
output = None |
|
|
for i in range(TIMEOUT//DELAY): |
|
|
for i in range(TIMEOUT//DELAY): |
|
|