Code Monkey home page Code Monkey logo

ask-my-pdf's People

Contributors

carelfdewaal avatar mobarski avatar qixiaobo 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

ask-my-pdf's Issues

ai_bricks.api

I have tried everything and I cannot install this module. Any pointers/tips?

from ai_bricks.api import openai

This line of code doesn't work at all....

Screenshot 2023-05-23 at 15 29 54

This model's maximum context length is 8191 tokens, however you requested 13831 tokens (13831 in your prompt; 0 for the completion).

InvalidRequestError: This model's maximum context length is 8191 tokens, however you requested 13831 tokens (13831 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.
Traceback:
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 561, in _run_script
self._session_state.on_script_will_rerun(rerun_data.widget_states)
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/safe_session_state.py", line 68, in on_script_will_rerun
self._state.on_script_will_rerun(latest_widget_states)
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 474, in on_script_will_rerun
self._call_callbacks()
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 487, in _call_callbacks
self._new_widget_state.call_callback(wid)
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/state/session_state.py", line 242, in call_callback
callback(*args, **kwargs)

where i should and .env file ?

should i add on root?
also for what is this specify please?
thanks you so much
Redis configuration (for persistent usage statistics / user feedback):

Deprecation Error

DeprecationError: PdfFileReader is deprecated and was removed in PyPDF2 3.0.0. Use PdfReader instead.

Have you tried pdfplumber instead?

Multiple files

Question:
Is it possible to load multiple files at a time?
This way I could ask a question and it could search all the resource documents to compile an answer.

Stream Responses like chatGPT

Is there any way to stream text by segmenting the fragments from model.query? The loading times to render the entire text block for larger PDFs is a bit too long.

persintency among sessions

could it be possible to recover stored vector indexes across sessions (same API key ) at least within 90 days?

AttributeError: module 'tiktoken' has no attribute 'encoding_for_model'

Getting the following error when launching the app

File "C:\Users\xxx\Anaconda3\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.__dict__) File "C:\Users\xxx\ask-my-pdf\src\gui.py", line 20, in <module> import model File "C:\Users\xxx\ask-my-pdf\src\model.py", line 12, in <module> import ai File "C:\Users\xxx\ask-my-pdf\src\ai.py", line 39, in <module> tokenizer_model = openai.model('text-davinci-003') File "C:\Users\xxx\Anaconda3\lib\site-packages\ai_bricks\api\openai.py", line 30, in model return _class(name, **kwargs) File "C:\Users\xxx\Anaconda3\lib\site-packages\ai_bricks\api\openai.py", line 57, in __init__ self.encoder = tiktoken.encoding_for_model(name)

ClientError: An error occurred (InvalidArgument) when calling the ListObjects operation: Unknown

I got the following error:

ClientError: An error occurred (InvalidArgument) when calling the ListObjects operation: Unknown
Traceback:
File "/usr/local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
File "/Users/canalescl/personal/replit/ask-my-pdf/src/gui.py", line 248, in <module>
    ui_pdf_file()
File "/Users/canalescl/personal/replit/ask-my-pdf/src/gui.py", line 91, in ui_pdf_file
    filenames += ss['storage'].list()
File "/Users/canalescl/personal/replit/ask-my-pdf/src/storage.py", line 46, in list
    return [self.decode(name) for name in self._list()]
File "/Users/canalescl/personal/replit/ask-my-pdf/src/storage.py", line 184, in _list
    resp = self.s3.list_objects(
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 530, in _api_call
    return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 960, in _make_api_call
    raise error_class(parsed_response, operation_name)

A new folder, cloned from zero, after "Enter your OpenAI API key" and click Enter

image

Question

is it necessary to use open ia API key or if you have any advices to create the api from scratch?

Storage/cache mode does not work when local/disk

Hi,
no problem running your demo but something on my side went wrong when trying to setup in run.sh these parameters:
STORAGE_MODE=LOCAL and CACHE_MODE=DISK.
No data is saved under cache/storage folder on disk.
Same problems on REDIS but maybe is something linked to issues above.
Any idea?
Thank you

Questions and answers

Would it be possible to read the document and then get GPT to generate x number of questions and answers based on the text.
This could be used to train an AI bot to help answer questions.

My scenario would be around training an AI to be able to explain a company specific topic. Say you got it to read all internal documents on a certain subject - generated over many years. if it then generated 1000's of questions and answers - you could then train a bot to help users.

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.