kosmos-2
When I use the following code to call the API of kosmos-2, but no answer is returned, and I put "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", # Replace str (filepath or URL to image) in 'Test Image' Image component with own local image path and report an error. How does this need to be resolved. ValueError Traceback (most recent call last) /root/hdd/JHQ/unilm/kosmos-2/gradio_api.ipynb cell 1 line 4 1 from gradient_client import Client 3 client = Client("http://127.0.0.1:7860/") ----> 4 result = client.predict( 5 "/root/hdd/unilm/kosmos-2/output/user_input_test_image_show_box_on_image.jpg_1.jpg", # str (filepath or URL to image) in 'Test Image' Image component", # str (filepath or URL to image ) in 'Test Image' Image component 6 "Brief", # str in 'Description Type' Radio component 7 True, # bool in 'Enable Sampling' Checkbox component 8 0.1, # int | float (numeric value between 0.1 and 1) in 'Sampling: Top-P' Slider component 9 0.1, # int | float (numeric value between 0.1 and 1) in 'Sampling: Temperature' Slider component 10 fn_index=2 11) 12 print(result)
File /usr/local/lib/python3.10/dist-packages/gradio_client/client.py:272, in Client.predict(self, api_name, fn_index, *args) 251 def predict( 252 self, 253 *args, 254 api_name: str | None = None, 255 fn_index: int | None = None, 256 ) -> Any: 257 """ 258 Calls the Gradio API and returns the result (this is a blocking call). 259 ... 663 response = requests.post( 664 self.client.api_url, headers=self.client.headers, data=data 665 )
ValueError: None