Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like to execute "gradio_client" reference #35

Open
choibigo opened this issue Nov 15, 2023 · 0 comments
Open

I would like to execute "gradio_client" reference #35

choibigo opened this issue Nov 15, 2023 · 0 comments

Comments

@choibigo
Copy link

choibigo commented Nov 15, 2023

image

I found this reference in your demo

i try to execute from this method with below code

from gradio_client import Client

client = Client("http://127.0.0.1:7860/")
result = client.predict(
		"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png",	# str (filepath on your computer (or URL) of image) in 'parameter_5' Image component
		"Howdy!",	# str  in 'User' Textbox component
		fn_index=0
)
print(result)

But i got this error

Traceback (most recent call last):
  File "/home/cbigo/workspace/LaVIN/my_test.py", line 4, in <module>
    result = client.predict(
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 292, in predict
    return self.submit(*args, api_name=api_name, fn_index=fn_index).result()
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 1131, in result
    return super().result(timeout=timeout)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/concurrent/futures/_base.py", line 444, in result
    return self.__get_result()
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 799, in _inner
    predictions = self.process_predictions(*predictions)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 991, in process_predictions
    predictions = self.deserialize(*predictions)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 977, in deserialize
    [
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/client.py", line 978, in <listcomp>
    s.deserialize(
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/serializing.py", line 206, in deserialize
    file = utils.decode_base64_to_file(x, dir=save_dir)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/utils.py", line 449, in decode_base64_to_file
    data, extension = decode_base64_to_binary(encoding)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/utils.py", line 414, in decode_base64_to_binary
    extension = get_extension(encoding)
  File "/home/cbigo/anaconda3/envs/lavin/lib/python3.8/site-packages/gradio_client/utils.py", line 360, in get_extension
    encoding = encoding.replace("audio/wav", "audio/x-wav")
AttributeError: 'dict' object has no attribute 'replace'

I would like to execute this reference

Please tell me how to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant