Comments (4)
Facing the same issue as well.
from gradio.
Hi @yangmingbai - is it possible the api is returning an empty string in res_data["data"]["images"]
?
@sachin-aakash , are you using the same demo?
from gradio.
@freddyaboulton,Thanks,This is an error raised by requests, requests.Post throw an error "Connection aborted.RemoteDisconnected('Remote end closed connection without response')", Thanks again!
from gradio.
Hi @yangmingbai - is it possible the api is returning an empty string in
res_data["data"]["images"]
?@sachin-aakash , are you using the same demo?
No, here is my code and the error -
def pdf_process(file):
pdf_file_path = file
dir_location = os.path.dirname(pdf_file_path[0])
filename = os.path.split(pdf_file_path[0])
pdf_name = filename[1].split(".pdf")[0]
command = ["node", "pdfToImageDynamic.js", quote(pdf_file_path[0]), dir_location, pdf_name]
subprocess.run(command, check=True)
image_name = os.path.join(dir_location,pdf_name + ".1.png")
try:
elements = partition_image(filename=image_name, strategy=strategy,infer_table_structure=True)
elements_to_json(elements, filename=f"{image_name}.json")
output_final = process_json_file(f"{image_name}.json",dir_location,pdf_name)
print(output_final)
return output_final
except subprocess.CalledProcessError as e:
print("Error" + e.output)
pass
as you can see it is printing out the path to the file that i am returning -
/private/var/folders/lx/kvs2jbr52gj0ll9mcpm35j4c0000gn/T/gradio/30a2a6abd0a693be05828e4645c14d2839bbae2f/Australia and New Zealand Banking Group April Green Bean Packagingprompt_2.txt
Traceback (most recent call last):
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/queueing.py", line 527, in process_events
response = await route_utils.call_process_api(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/route_utils.py", line 270, in call_process_api
output = await app.get_blocks().process_api(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/blocks.py", line 1870, in process_api
data = [
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/blocks.py", line 1871, in <listcomp>
await self.postprocess_data(fn_index, list(o), state)
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/blocks.py", line 1725, in postprocess_data
outputs_cached = await processing_utils.async_move_files_to_cache(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/processing_utils.py", line 479, in async_move_files_to_cache
return await client_utils.async_traverse(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio_client/utils.py", line 999, in async_traverse
return await func(json_obj)
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/processing_utils.py", line 453, in _move_to_cache
temp_file_path = await block.async_move_resource_to_block_cache(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/blocks.py", line 286, in async_move_resource_to_block_cache
temp_file_path = processing_utils.save_file_to_cache(
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/processing_utils.py", line 257, in save_file_to_cache
temp_dir = hash_file(file_path)
File "/Users/schhatbar/anaconda3/envs/unity/lib/python3.9/site-packages/gradio/processing_utils.py", line 189, in hash_file
with open(file_path, "rb") as f:
IsADirectoryError: [Errno 21] Is a directory: '/'
This code was working fine before i updated gradio to the latest version.
from gradio.
Related Issues (20)
- Add option to use default <audio> tag HOT 6
- .select Event has abnormal behavior with gr.File
- gradio.image events has a strange behavior using the past option HOT 1
- Have the possibility to output audio in gr.Dataframe HOT 3
- new gradio version failed with CERTIFICATE_VERIFY_FAILED while old version not
- Cannot cache examples if the Plot output is large (Gradio 4.26+)
- Can gradio add a vertical scrollbar to the textbox? HOT 2
- Refactor backend cancelling logic
- Badges in the Pypi README are broken
- Fix the iframe size in the deployed space for prs
- Code component horizontal scrollbar does not take line numbers into account
- Cannot call "send" once a close message has been sent. HOT 2
- Uncaught (in promise) DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node. HOT 4
- Client, is requests available ? HOT 1
- Unable to programatically update gr.Examples
- CSS can't load in localhost when using asymetric port mapping with docker and nginx reverse proxy HOT 5
- Unable to reference TextBox when loading HF Space with gr.load.
- Z-index issue with loading bar
- AttributeError: 'Image' object has no attribute 'value' HOT 2
- Streaming complex object fast in custom component makes bug HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.