API error

#19
by programORdie2 - opened

When i try to acces this via the api, i get the error: error: None

Hi @programORdie2
Does the error still occur? I just tested it and it worked for me. There was an infra issue yesterday, so maybe it was a temporary error.

Uh, yes, it still sys: ValueError: None. This is my code:

from gradio_client import Client
client = Client("https://hysts-shap-e.hf.space/")
result = client.predict(
"A dog", # str in 'Prompt' Textbox component
0, # int | float (numeric value between 0 and 2147483647) in 'Seed' Slider component
1, # int | float (numeric value between 1 and 20) in 'Guidance scale' Slider component
1, # int | float (numeric value between 1 and 100) in 'Number of inference steps' Slider component
api_name="/text-to-3d"
)
print(result)

I also tried using POST requests to the api endpoint but it gave the response: {"error": None} with status code 500.

@programORdie2 Thanks for the additional info. The error occurs in my environment too with your code. Weird thing is that it works if guidance_scale is set to a larger number than 1, like 15 or 1.0001.
I'm not sure why this occurs, though. The inference code can take 1 as the value.
I'll look into it, but maybe you can use larger guidance_scale for now.

@programORdie2 The error was due to the use of an old version of diffusers in this Space, and now it's fixed.

Traceback (most recent call last):
File "/home/secret/txt23D.py", line 4, in
result = client.predict(
File "/home/secret/.local/lib/python3.9/site-packages/gradio_client/client.py", line 286, in predict
return self.submit(*args, api_name=api_name, fn_index=fn_index).result()
File "/home/secret/.local/lib/python3.9/site-packages/gradio_client/client.py", line 1127, in result
raise self.future._exception # type: ignore
File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/secret/.local/lib/python3.9/site-packages/gradio_client/client.py", line 787, in _inner
predictions = _predict(*data)
File "/home/secret/.local/lib/python3.9/site-packages/gradio_client/client.py", line 819, in _predict
raise ValueError(result["error"])
ValueError: None

But i'll just set the scale to something else.

@programORdie2 Thanks for reporting. Alright, looks like the following error still occurs when num_inference_steps=1. I've just updated the minimum number of num_inference_steps to 2.

  File "/home/user/app/model.py", line 32, in run_text
    images = self.pipe(
  File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/site-packages/diffusers/pipelines/shap_e/pipeline_shap_e.py", line 333, in __call__
    mesh = self.shap_e_renderer.decode_to_mesh(
  File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/site-packages/diffusers/pipelines/shap_e/renderer.py", line 1036, in decode_to_mesh
    textures = torch.cat(textures, dim=1)
RuntimeError: torch.cat(): expected a non-empty list of Tensors
hysts changed discussion status to closed

Sign up or log in to comment