Giter Site home page Giter Site logo

mukulpatnaik / researchgpt Goto Github PK

View Code? Open in Web Editor NEW
3.6K 3.6K 339.0 593 KB

A LLM based research assistant that allows you to have a conversation with a research paper

Home Page: https://www.dara.chat

License: MIT License

Python 43.20% HTML 12.19% JavaScript 39.15% CSS 5.46%

researchgpt's People

Contributors

mukulpatnaik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

researchgpt's Issues

Increasing maximum paper length to not run into AttributeError: 'DataFrame' object has no attribute 'embeddings'

I noticed when putting a pdf with about 30 pages into the program I get the Error: AttributeError: 'DataFrame' object has no attribute 'embeddings'. I think it would be useful that for the time being that the program warns you that the text is too long and cannot be read in.

I understand that the API has a token limit but also a memory, would it be possible to expand the code to splice up longer pdfs so that it can be fed to the api bit by bit in the background.

Further I would like to know what amount of pages on average is a safe number to input for the current build, what are your experiences?

Hosting on my site

I'm trying to host this on my site and when I upload a pdf I get the following errors:

POST https://[MYSITE]/process_pdf 403
(anonymous) @ script.js:170

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
(anonymous) @ script.js:189
Promise.catch (async)
(anonymous) @ script.js:187

Any help would be appreciated.

ModuleNotFoundError: No module named 'sklearn'

from openai.embeddings_utils import get_embedding, cosine_similarity
File "/opt/homebrew/lib/python3.10/site-packages/openai/embeddings_utils.py", line 7, in
from sklearn.decomposition import PCA
ModuleNotFoundError: No module named 'sklearn'

Clarification on variable 'CLOUD_STORAGE_BUCKET'

Hello,

Thank you for your effort in developing this tool!

I am trying to deploy a local version of this, however is not sure what is this 'CLOUD_STORAGE_BUCKET' variable. I can tell that its for google cloud, but i am not sure how to setup this BUCKET thing to get this app to work locally.

If you can provide more detail about this is REAME, that would be great!

Thanks,
Michael

No results displayed after loading URL

From a Windows 10 desktop, running in PowerShell, in a Conda virtual environment, I tried the same URL you did in your demo
https://arxiv.org/pdf/1706.03762.pdf but was not successful.
The UI continues to display the message "Loading..."

Here is the output from the command line:

10.20.30.40 - - [15/Feb/2023 10:59:57] "GET / HTTP/1.1" 200 -
{'Date': 'Wed, 15 Feb 2023 16:00:41 GMT', 'Server': 'Apache', 'Strict-Transport-Security': 'max-age=31536000', 'Set-Cookie': 'browser=12.46.106.164.1676476842433583; path=/; max-age=946080000; domain=.arxiv.org', 'Last-Modified': 'Thu, 07 Dec 2017 01:03:18 GMT', 'ETag': '"16bf6527-219864-55fb5a236f4fb"', 'Accept-Ranges': 'bytes', 'Content-Length': '2201700', 'Access-Control-Allow-Origin': '*', 'Keep-Alive': 'timeout=8, max=100', 'Connection': 'Keep-Alive', 'Content-Type': 'application/pdf'}
Parsing paper
Total number of pages: 15
Done parsing paper
Creating dataframe
Done creating dataframe
Calculating embeddings
Done calculating embeddings
Done processing pdf
10.20.30.40 - - [15/Feb/2023 11:00:53] "POST /download_pdf HTTP/1.1" 200 -

Error: Request to OpenAI failed. Please try again.

i have got error with /reply 500 error.
if i use url,i got NameError: name 'df' is not defined.
if i use document, i got IndexError: single positional indexer is out-of-bounds.
Can you guys help me. Sad!

Changing AI API

Curious if you know how this can be modified to use hugging face all-minilm-l6-v2 for the embeddings and gpt-neo2.7b. Could be a similar way to do it for free (or low cost in production) I've been working on modifying it but haven't quite figured it out yet. keep running into one bug or another.

why you validating a length of 30 characters

Hi, just want to clarify what is the purpose of this block

    for row in pdf:
        if len(row['text']) < 30:
            continue
        filtered_pdf.append(row)

Why the criteria is 30 characters ?

I'd like to contribute to the project, but first I need to understand a little bit about the implementation

ChatGPT API

I tried:

r = openai.ChatCompletion.create(
            model="gpt-3.5-turbo", 
            messages=prompt, 
            temperature=0.4, 
            max_tokens=1500)

in main-local.py
but doesn't work

Request for Multi-User Support in Public Deployment

Thank you for creating this amazing tool that benefits researchers. However, it currently only supports one user at a time, which may cause conflicts when deployed as a public service. It would be great if the tool could support multiple users to avoid such conflicts.

Problem when performing the 'python main-local.py'

Hi, I met this WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead when I was performing the python main-local.py, and I wonder what I could to handle this.

I got this error during installation

      error: Command "/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_18025979-d416-4757-81ac-797dee762f1112z4f54t/croots/recipe/python-split_1654083066155/_build_env/bin/llvm-ar rcs build/temp.macosx-11.1-arm64-3.9/libnpymath.a build/temp.macosx-11.1-arm64-3.9/numpy/core/src/npymath/npy_math.o build/temp.macosx-11.1-arm64-3.9/build/src.macosx-11.1-arm64-3.9/numpy/core/src/npymath/ieee754.o build/temp.macosx-11.1-arm64-3.9/build/src.macosx-11.1-arm64-3.9/numpy/core/src/npymath/npy_math_complex.o build/temp.macosx-11.1-arm64-3.9/numpy/core/src/npymath/halffloat.o" failed with exit status 127
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Syntax error when self-hosting

I get the following error when trying to run the .py script after copying the repo on my server:

:~/researchgpt$ python main-local.py
  File "main-local.py", line 20
    print(f"Total number of pages: {number_of_pages}")


SyntaxError: invalid syntax

"File Does Not Exist" after Question

On the demo, after uploading any PDF and entering a question, I get the message "File Does Not Exist".
I tried using different OpenAI APIs and different PDFs.

Consol:
Uncaught (in promise) ReferenceError: error is not defined
at create_prompt (script.js:152:66)
at async HTMLButtonElement. (script.js:246:14)

seem doesn't work on AWS EC2 (maybe my wrong setup...)

After I run root@ip-172-31-2-32:/home/ubuntu/researchgpt# python3 main-local.py

I got these as follows:

  • Serving Flask app 'main-local'
  • Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:8080
  • Running on http://172.31.2.32:8080
    Press CTRL+C to quit
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 175-455-407

but when I copy http://172.31.2.32:8080 into a Chrome broswer , I got error message:

Unable to reach this site 172.31.2.32 is taking too long to respond.
Please try the following:

check network connection
Check proxy servers and firewalls
Run Windows Network Diagnostics
ERR_CONNECTION_TIMED_OUT

Any suggestion to fix this? thanks much!

KeyError: 'text'

Traceback (most recent call last):
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3802, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5745, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5753, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'text'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 2551, in call
return self.wsgi_app(environ, start_response)
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 2531, in wsgi_app
response = self.handle_exception(e)
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/Users/tom/Downloads/researchgpt/main-local.py", line 158, in process_pdf
df = chatbot.paper_df(paper_text)
File "/Users/tom/Downloads/researchgpt/main-local.py", line 81, in paper_df
df['length'] = df['text'].apply(lambda x: len(x))
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/pandas/core/frame.py", line 3807, in getitem
indexer = self.columns.get_loc(key)
File "/Users/tom/miniconda3/envs/researchgpt-main/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 3804, in get_loc
raise KeyError(key) from err
KeyError: 'text'

reply:Error: Request to OpenAI failed. Please try again. is it a network problem?

屏幕截图 2023-04-05 131225

Done calculating embeddings
Done processing pdf
127.0.0.1 - - [05/Apr/2023 13:23:44] "POST /process_pdf HTTP/1.1" 200 -
127.0.0.1 - - [05/Apr/2023 13:24:12] "POST /reply HTTP/1.1" 500 -
Traceback (most recent call last):
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 2551, in call
return self.wsgi_app(environ, start_response)
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 2531, in wsgi_app
response = self.handle_exception(e)
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "F:\ChatGPT\researchgpt-main\main-local.py", line 181, in reply
prompt = chatbot.create_prompt(df, query)
File "F:\ChatGPT\researchgpt-main\main-local.py", line 112, in create_prompt
result = self.search_embeddings(df, user_input, n=3)
File "F:\ChatGPT\researchgpt-main\main-local.py", line 107, in search_embeddings
sources.append({'Page '+str(results.iloc[i]['page']): results.iloc[i]['text'][:150]+'...'})
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\pandas\core\indexing.py", line 1103, in getitem
return self._getitem_axis(maybe_callable, axis=axis)
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\pandas\core\indexing.py", line 1656, in _getitem_axis
self._validate_integer(key, axis)
File "F:\ChatGPT\researchgpt-main\myenv\lib\site-packages\pandas\core\indexing.py", line 1589, in _validate_integer
raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

Supplement: I am deploying in a virtual environment:python -m venv myenv;myenv\Scripts\activate;python main-local.py

Installation fails

The error happens at the stage of installing dependencies.

ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

Macbook Air M1
MacOS Monterey

y/lib
            copying numpy/lib/scimath.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/_version.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/user_array.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/format.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/twodim_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/financial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/index_tricks.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/npyio.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/shape_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/stride_tricks.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/utils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/arrayterator.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/function_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/arraysetops.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/arraypad.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/type_check.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/polynomial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/_datasource.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            copying numpy/lib/ufunclike.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib
            creating build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_type_check.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_utils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_twodim_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_polynomial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test__iotools.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_shape_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_ufunclike.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_index_tricks.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_arrayterator.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test__version.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_io.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_arraysetops.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_function_base.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_arraypad.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_mixins.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_packbits.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test__datasource.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_stride_tricks.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_financial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_recfunctions.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_nanfunctions.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_format.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_histograms.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            copying numpy/lib/tests/test_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/lib/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/linalg
            copying numpy/linalg/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg
            copying numpy/linalg/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg
            copying numpy/linalg/linalg.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg
            creating build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            copying numpy/linalg/tests/test_linalg.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            copying numpy/linalg/tests/test_deprecations.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            copying numpy/linalg/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            copying numpy/linalg/tests/test_build.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            copying numpy/linalg/tests/test_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/linalg/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/extras.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/testutils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/core.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/bench.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/timer_comparison.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            copying numpy/ma/mrecords.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma
            creating build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_old_ma.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_core.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_deprecations.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_subclassing.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_extras.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_mrecords.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            copying numpy/ma/tests/test_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/ma/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib
            copying numpy/matrixlib/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib
            copying numpy/matrixlib/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib
            copying numpy/matrixlib/defmatrix.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib
            creating build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_matrix_linalg.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_defmatrix.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_interaction.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_numeric.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_masked_matrix.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_multiarray.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            copying numpy/matrixlib/tests/test_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/matrixlib/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/laguerre.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/_polybase.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/polyutils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/hermite_e.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/chebyshev.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/polynomial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/legendre.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            copying numpy/polynomial/hermite.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial
            creating build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_chebyshev.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_hermite_e.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_polynomial.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_laguerre.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_legendre.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_printing.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_hermite.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_classes.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            copying numpy/polynomial/tests/test_polyutils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/polynomial/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/random
            copying numpy/random/_pickle.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random
            copying numpy/random/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random
            copying numpy/random/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random
            creating build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_generator_mt19937.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_randomstate.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_direct.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_extending.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_smoke.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_randomstate_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_seed_sequence.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_generator_mt19937_regressions.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_random.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            copying numpy/random/tests/test_regression.py -> build/lib.macosx-10.9-universal2-3.9/numpy/random/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/testing
            copying numpy/testing/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing
            copying numpy/testing/setup.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing
            copying numpy/testing/utils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing
            copying numpy/testing/print_coercion_tables.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing
            creating build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/nosetester.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/noseclasses.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/utils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/parameterized.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            copying numpy/testing/_private/decorators.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/_private
            creating build/lib.macosx-10.9-universal2-3.9/numpy/testing/tests
            copying numpy/testing/tests/test_utils.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/tests
            copying numpy/testing/tests/test_decorators.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/tests
            copying numpy/testing/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/tests
            copying numpy/testing/tests/test_doctesting.py -> build/lib.macosx-10.9-universal2-3.9/numpy/testing/tests
            creating build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_warnings.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_matlib.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_ctypeslib.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_numpy_version.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/__init__.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_reloading.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_public_api.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            copying numpy/tests/test_scripts.py -> build/lib.macosx-10.9-universal2-3.9/numpy/tests
            running build_clib
            customize UnixCCompiler
            customize UnixCCompiler using new_build_clib
            building 'npymath' library
            compiling C sources
            C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

            creating build/temp.macosx-10.9-universal2-3.9
            creating build/temp.macosx-10.9-universal2-3.9/numpy
            creating build/temp.macosx-10.9-universal2-3.9/numpy/core
            creating build/temp.macosx-10.9-universal2-3.9/numpy/core/src
            creating build/temp.macosx-10.9-universal2-3.9/numpy/core/src/npymath
            creating build/temp.macosx-10.9-universal2-3.9/build
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath
            compile options: '-Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c'
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath/npy_math_complex.c
            clang: numpy/core/src/npymath/npy_math.c
            clang: numpy/core/src/npymath/halffloat.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath/ieee754.c
            ar: adding 4 object files to build/temp.macosx-10.9-universal2-3.9/libnpymath.a
            warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: build/temp.macosx-10.9-universal2-3.9/libnpymath.a will be fat and ar(1) will not be able to operate on it
            ranlib:@ build/temp.macosx-10.9-universal2-3.9/libnpymath.a
            building 'npysort' library
            compiling C sources
            C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort
            compile options: '-Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c'
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/timsort.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/heapsort.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/mergesort.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/binsearch.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/radixsort.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/selection.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npysort/quicksort.c
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            22 warnings generated.
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
                    npy_intp k;
                    ^~~~~~~~~~~
            numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
                else if (0 && kth == num - 1) {
                         ^
                         /* DISABLES CODE */ ( )
            22 warnings generated.
            ar: adding 7 object files to build/temp.macosx-10.9-universal2-3.9/libnpysort.a
            warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: build/temp.macosx-10.9-universal2-3.9/libnpysort.a will be fat and ar(1) will not be able to operate on it
            ranlib:@ build/temp.macosx-10.9-universal2-3.9/libnpysort.a
            building 'npyrandom' library
            compiling C sources
            C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

            creating build/temp.macosx-10.9-universal2-3.9/numpy/random
            creating build/temp.macosx-10.9-universal2-3.9/numpy/random/src
            creating build/temp.macosx-10.9-universal2-3.9/numpy/random/src/distributions
            compile options: '-Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c'
            clang: numpy/random/src/distributions/logfactorial.c
            clang: numpy/random/src/distributions/distributions.c
            clang: numpy/random/src/distributions/random_mvhg_count.c
            clang: numpy/random/src/distributions/random_mvhg_marginals.c
            clang: numpy/random/src/distributions/random_hypergeometric.c
            ar: adding 5 object files to build/temp.macosx-10.9-universal2-3.9/libnpyrandom.a
            warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: archive library: build/temp.macosx-10.9-universal2-3.9/libnpyrandom.a will be fat and ar(1) will not be able to operate on it
            ranlib:@ build/temp.macosx-10.9-universal2-3.9/libnpyrandom.a
            running build_ext
            customize UnixCCompiler
            customize UnixCCompiler using new_build_ext
            building 'numpy.core._multiarray_tests' extension
            compiling C sources
            C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/multiarray
            creating build/temp.macosx-10.9-universal2-3.9/numpy/core/src/common
            compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c'
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/_multiarray_tests.c
            clang: numpy/core/src/common/mem_overlap.c
            clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -Wl,-headerpad,0x1000 build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/_multiarray_tests.o build/temp.macosx-10.9-universal2-3.9/numpy/core/src/common/mem_overlap.o -Lbuild/temp.macosx-10.9-universal2-3.9 -lnpymath -o build/lib.macosx-10.9-universal2-3.9/numpy/core/_multiarray_tests.cpython-39-darwin.so
            ld: warning: -undefined dynamic_lookup may not work with chained fixups
            ld: warning: -undefined dynamic_lookup may not work with chained fixups
            building 'numpy.core._multiarray_umath' extension
            compiling C sources
            C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration

            creating build/temp.macosx-10.9-universal2-3.9/numpy/core/src/multiarray
            creating build/temp.macosx-10.9-universal2-3.9/numpy/core/src/umath
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/umath
            creating build/temp.macosx-10.9-universal2-3.9/build/src.macosx-10.9-universal2-3.9/numpy/core/src/common
            creating build/temp.macosx-10.9-universal2-3.9/private
            creating build/temp.macosx-10.9-universal2-3.9/private/var
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2/numpy_aa6e8fc52b974c61ab810e0fc6963c0f
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2/numpy_aa6e8fc52b974c61ab810e0fc6963c0f/numpy
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2/numpy_aa6e8fc52b974c61ab810e0fc6963c0f/numpy/_build_utils
            creating build/temp.macosx-10.9-universal2-3.9/private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2/numpy_aa6e8fc52b974c61ab810e0fc6963c0f/numpy/_build_utils/src
            compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/umath -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c'
            extra options: '-faltivec -I/System/Library/Frameworks/vecLib.framework/Headers'
            clang: numpy/core/src/multiarray/alloc.c
            clang: numpy/core/src/multiarray/array_assign_scalar.c
            clang: numpy/core/src/multiarray/buffer.c
            clang: numpy/core/src/multiarray/common.c
            clang: numpy/core/src/multiarray/conversion_utils.c
            clang: numpy/core/src/multiarray/datetime_strings.c
            clang: numpy/core/src/multiarray/descriptor.c
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/einsum.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/hashdescr.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/lowlevel_strided_loops.c
            clang: numpy/core/src/multiarray/multiarraymodule.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/nditer_constr.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/refcount.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/scalarapi.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/temp_elide.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/multiarray/vdot.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/umath/loops.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/umath/ufunc_object.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/umath/ufunc_type_resolution.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath/ieee754.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: numpy/core/src/common/array_assign.c
            clang: numpy/core/src/common/ucsnarrow.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: build/src.macosx-10.9-universal2-3.9/numpy/core/src/common/npy_cpu_features.c
            clang: /private/var/folders/f1/yvjx9d891rg0b8kqrvv4x26w0000gp/T/pip-install-03vxh7y2/numpy_aa6e8fc52b974c61ab810e0fc6963c0f/numpy/_build_utils/src/apple_sgemv_fix.c
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
            error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/umath -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/common -Ibuild/src.macosx-10.9-universal2-3.9/numpy/core/src/npymath -c numpy/core/src/multiarray/buffer.c -o build/temp.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/buffer.o -MMD -MF build/temp.macosx-10.9-universal2-3.9/numpy/core/src/multiarray/buffer.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
gr703z@ALT06127 researchgpt %

Is there a bug in Line64 of parse_paper

paper_text += processed_text

for i in range(number_of_pages):
    ...
   for t in page_text:
       """do something on processed_text"""
       ...
       paper_text += processed_text 

In this line, paper_text add processed_text to it during each iteration in page_text, but processed_text seems to grow to include the text of the whole page in the end. There seems to be a lot of duplicates.

When I change the codes to the following, the duplicates can be removed in paper_text.

for i in range(number_of_pages):
    ...
   for t in page_text:
       """do something on processed_text"""
       ...
   paper_text += processed_text 

Wrong output

I was asking question "Summarise the paper" on the paper "End-To-End Bias Mitigation: Removing Gender Bias in Deep Learning"

and it giving me this answer

This paper examines the effects of a new type of drug on a particular medical condition. The study was conducted on a sample of 100 participants, with 50 receiving the drug and 50 receiving a placebo. The results showed that the drug had a significant effect on the condition, with a reduction in symptoms in the group receiving the drug compared to the group receiving the placebo. The study also found that the drug had no adverse side effects. This study provides evidence that this new drug could be a safe and effective treatment for this medical condition.

OpenAI API key might invalid

I am getting this issue again and again

Error: Your OpenAI API key might invalid. Please make sure you entered your key correctly. If you would like to set it again, please close the tab and try again. Sorry for the inconvenience!

Save embeddings

Hello, thanks for this!

Should this also work well for longer texts like books? And if so, can it easily be made to cache the embeddings to disk? I'm assuming it's not that cheap nor fast to do that every time if it's a long thing, right?

improve search_embeddings()

Since this platform mainly consists of researchers involved in academic studies, we can discuss academic issues.

In the search_embeddings( ) function, only similarity sorting and selection of the top n=3 are done. Is there enough reason for this, or does it need to be improved?

I think it is possible to make a selection based on the distribution of similarity. We can select up to the highest point, and if it is a unimodal distribution, the top three should be the corpus near the peak. However, if the similarity distribution is not unimodal, like 2 peaks, selecting the top three directly may cause damage to the corpus, and it may be necessary to select the corpus near the peak and the surrounding area.

One possible method is to select the corpora based on the distribution of similarity. If the similarity distribution is unimodal, we can select the corpora near the peak of the similarity distribution, which should be the ones with the highest similarity. If the similarity distribution is not unimodal, we can select the corpus near the peak and its surrounding area to preserve the overall shape of similarity.

Selecting corpora based on similarity, the most complex (but maybe the best) approach may be to use a Transformer attention mechanism on sentence or paragraph level embedding-vectors to select appropriate reference corpora based on content.

save the embedding DataFrame

When running locally, the embedding needs to be calculated every time the same PDF is opened, which is somewhat wasteful. It would be best to save the embedding dataframe so that it can be checked before the next use. If the embedding has already been done, it doesn't need to be done again. Additionally, can the embedding dataframe be used as a search index in Zotero?

raise IndexError("single positional indexer is out-of-bounds")

[01/Mar/2023 17:07:00] "POST /reply HTTP/1.0" 500 -
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2551, in call
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2531, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/root/researchgpt/main-local.py", line 181, in reply
prompt = chatbot.create_prompt(df, query)
File "/root/researchgpt/main-local.py", line 112, in create_prompt
result = self.search_embeddings(df, user_input, n=3)
File "/root/researchgpt/main-local.py", line 107, in search_embeddings
sources.append({'Page '+str(results.iloc[i]['page']): results.iloc[i]['text'][:150]+'...'})
File "/usr/local/lib/python3.9/dist-packages/pandas/core/indexing.py", line 1073, in getitem
return self._getitem_axis(maybe_callable, axis=axis)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/indexing.py", line 1625, in _getitem_axis
self._validate_integer(key, axis)
File "/usr/local/lib/python3.9/dist-packages/pandas/core/indexing.py", line 1557, in _validate_integer
raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds

Please reduce your prompt; or completion length.

Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2551, in call
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2531, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2528, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.9/dist-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/root/researchgpt/main-local.py", line 182, in reply
response = chatbot.gpt(prompt)
File "/root/researchgpt/main-local.py", line 134, in gpt
r = openai.Completion.create(model="text-davinci-003", prompt=prompt, temperature=0.4, max_tokens=1500)
File "/usr/local/lib/python3.9/dist-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/usr/local/lib/python3.9/dist-packages/openai/api_requestor.py", line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File "/usr/local/lib/python3.9/dist-packages/openai/api_requestor.py", line 619, in _interpret_response
self._interpret_response_line(
File "/usr/local/lib/python3.9/dist-packages/openai/api_requestor.py", line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens, however you requested 8842 tokens (7342 in your prompt; 1500 for the completion). Please reduce your prompt; or completion length.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.