pdfGPT
                                
                                
                                
                                    pdfGPT copied to clipboard
                            
                            
                            
                        M1 Mac Tensorflow
Anyone able to get this to work on MacOS? I am trying to get this working in a virtual environment with Python 3.10 and have to use tensorflow-macos and tensorflow-metal.
Unsure what to change in requirements but I keep getting errors when trying to install all the dependencies.
On mobile right now but will update with full errors when I get back to my laptop.
I'm having the same problem the same problem. Hopefully someone can come up with a fix for Apple M1 users.
I had the same issue, you have to downgrade your version to python 3.9. Create the 3.9 version in your environment. instead.
Just an update, even though I no longer got the Tensorflow error, I got an illegal hardware error on my Mac M1 as well. I don't think his script works with M1's, since GPT-4 diagnosed the issue as a hardware incompatibility with Tensorflow.
The code was written to work on Huggingface, not localhost (win/mac).
The code was written to work on Huggingface, not localhost (win/mac).
Any plans to have it work on localhost (win/mac) or web server?
I will release a code working on Windows localhost. I am sorry, I do not have a Mac to test it.
Would be happy to have someone contribute the mac version of running code.
You can run this on localhost using docker:
docker run -it -p 7860:7860 --platform=linux/amd64 registry.hf.space/bhaskartripathi-pdfchatter:latest python app.py
Here is an example: https://gradio.app/sharing-your-app/#embedding-hosted-spaces
Hey thanks so much for responding! I wasn't meaning to complain about it - I just shared a fix to the Tensorflow problem, but it created new ones and I suspected it was a Mac issue.
I wanted a local version cause I wanted to try to add a bunch of features to it, like multiple PDF support, and some prompt processing before it gets embedded into a vector. I'm not familiar with docker but I am sure I can figure it out.
How is this embedding free whereas OpenAI's embedding and Pinecone cost money? Who's processing and storing the vectors for free?
This embedding uses Google's universal sentence encoder which is free. Huggingface has hosted it for free but local might be faster as HF infra is free but little slow. You can download the embedding model on local and then try. My GPU is way too outdated for it to run on local. However, if you have Rtx 3070 or above, it should work smoothly on local.
I can try and help with getting this running on a Mac. Also, I'm not quite understanding. What parts of the code would need changes/updates to get this to work on localhost (Mac, Linux or Windows - I have access to all and could help test)? Is the local model needed or can I just work with the hosted model but run the actual program locally?
I had the same issue, you have to downgrade your version to python 3.9. Create the 3.9 version in your environment. instead.
Odd, I tried that and I still was unable to install tensorflow.
Edit: Disregard that, using tensorflow-macos and tensorflow-metal I'm able to get a bit further. But running into multiple other errors as you mentioned.
I'll try and replicate this project from scratch on M1 and see how far I can get to try and get this working locally. Really wanna get this working as a webapp locally.
Really sorry to hear that, not sure why.
I am also willing to try helping on a Mac too, I can give him access to it if that helps, but I am not sure how to convert his script into a Mac.
For what it's worth, dezerving, I wrote a separate script that uses Langchain + OpenAI embeddings + Chroma (to store the vectors) to achieve the same function - can share if you are interested. The only problem is that OpenAI embeddings are kinda expensive, which defeats the whole purpose of trying to run bhaskaripathi's script.
Really sorry to hear that, not sure why.
I am also willing to try helping on a Mac too, I can give him access to it if that helps, but I am not sure how to convert his script into a Mac.
For what it's worth, dezerving, I wrote a separate script that uses Langchain + OpenAI embeddings + Chroma (to store the vectors) to achieve the same function - can share if you are interested. The only problem is that OpenAI embeddings are kinda expensive, which defeats the whole purpose of trying to run bhaskaripathi's script.
Would love to take a look, thanks! Can we not just swap OpenAI embeddings for Universal Sentence Encoder? I'll admit I need to do a bit more research.
I got it to work on an apple silicone.
(my python version 3.10)
You need to
pip3 install tensorflow-macos
pip3 install sklearn
pip3 install -U scikit-learn scipy matplotlib
I got it to work on an apple silicone. (my python version 3.10) You need to pip3 install tensorflow-macos pip3 install sklearn pip3 install -U scikit-learn scipy matplotlib
Thanks for this. This worked, along with using pipreqs and pinning versions (pip took over 30m otherwise to try and install from requirements.txt).
This was the result from that:
gradio==3.27.0
numpy==1.23.5
openai==0.27.4
PyMuPDF==1.22.1
scikit_learn==1.2.2
tensorflow_hub==0.13.0
                                    
                                    
                                    
                                
With the very helpful info found the above, I successfully installed in my macbook air (M2)!
- Clone this repo
 - In this repo, edit the 
requirements.txtfound below pip3 install -r requirements.txt- Run the app 
python3 app.py - Access to 
http://localhost:7860 
gradio==3.27.0
numpy==1.23.5
openai==0.27.4
PyMuPDF==1.22.1
matplotlib==3.7.1
scikit_learn==1.2.2
scipy==1.10.1
tensorflow-macos==2.12.0
tensorflow_hub==0.13.0
                                    
                                    
                                    
                                
With the very helpful info found the above, I successfully installed in my macbook air (M2)!
- Clone this repo
 - In this repo, edit the
 requirements.txtfound belowpip3 install -r requirements.txt- Run the app
 python3 app.py- Access to
 http://localhost:7860
It works with Macbook Air M1!!!! Thanks Mate!
thanks for resolving this issue