Git Product home page Git Product logo

Comments (3)

krandiash avatar krandiash commented on July 28, 2024

Do you mind pasting in what you ran, we can repro it

from meerkat.

dtnewman avatar dtnewman commented on July 28, 2024

sure. I did it in an ipython notebook, but i'll copy paste the cells here

import meerkat as mk
import os
import json

# set env variable
os.environ['OPENAI_API_KEY']  

with open('extracted_data.json') as f:
    extracted_data = json.load(f)

data = [dict(case_number=x[0], outcome=x[1], conclusion=x[2]) for x in extracted_data]
df = mk.DataFrame(data)


mk.gui.start(api_port=2023)


df['file_location'] = df['case_number'].apply(lambda x: './documents/' + x.lower() + "__merits_decision.pdf")


df["pdf"] = mk.files(df['file_location'], "pdf")



df.gui.gallery(main_column="pdf")


# go through each row of the dataframe and check if the file exists and remove otherwise

for row in df.iterrows():
    file_location = row['file_location']
    print(file_location)
    if not os.path.isfile(file_location):
        # remove the row from the dataframe
        df = df[df['file_location'] != file_location]


flash = mk.gui.contrib.FlashFill(df=df, target_column="outcome2")


df['outcome3'] = mk.complete(df, prompt=flash.prompt, engine="openai/text-davinci-003", batch_size=12)

that last line is where i got error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[16], line 1
----> 1 df['outcome3'] = mk.complete(df, prompt=flash.prompt, engine="openai/text-davinci-003", batch_size=12)

File [~/.virtualenvs/data_analysis_venv/lib/python3.10/site-packages/meerkat/ops/complete.py:43](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/daniel/code/data-analysis/chatgpt_pdf_project/~/.virtualenvs/data_analysis_venv/lib/python3.10/site-packages/meerkat/ops/complete.py:43), in complete(df, prompt, engine, batch_size, use_ray, num_blocks, blocks_per_window, pbar)
     38 from manifest import Manifest
     40 client_name, engine = engine.split("/")
     41 manifest = Manifest(
     42     client_name=client_name,
---> 43     client_connection=open("/Users/sabrieyuboglu/.meerkat/keys/.openai").read(),
     44     engine=engine,
     45     temperature=0,
     46     max_tokens=1,
     47     cache_name="sqlite",
     48     cache_connection="/Users/sabrieyuboglu/.manifest/cache.sqlite",
     49 )
     51 def _run_manifest(rows: mk.DataFrame):
     52     out = manifest.run([prompt.format(**row) for row in rows.iterrows()])

FileNotFoundError: [Errno 2] No such file or directory: '/Users/sabrieyuboglu/.meerkat/keys/.openai'

from meerkat.

ad12 avatar ad12 commented on July 28, 2024

thanks for the issue! we have added the fix in #362

from meerkat.

Related Issues (20)

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.