Comments (3)
Do you mind pasting in what you ran, we can repro it
from meerkat.
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.
thanks for the issue! we have added the fix in #362
from meerkat.
Related Issues (20)
- [BUG] Typo in setup.py for Cython dependency causes installation to sometimes fail HOT 1
- [BUG] Downloading imagenet does not work HOT 1
- [BUG] Quickstart is not working - No module named 'meerkat.contrib'
- [BUG] typing doesn't have Literal HOT 4
- About the interface to transform dataframe to Huggingface dataset with a column typed with Image. HOT 2
- [BUG] No file found when running demo script HOT 3
- [FEATURE] Add a Docker Github Action
- [BUG] pyarrow error in Gallery
- [BUG] Partial dataset download breaks `mk.datasets.get` HOT 3
- Issue on page /index.html - The link to blogpost doesn't work HOT 3
- [BUG] Button with icon=None raises HTTP 422 error
- [BUG] Demo fails for "python3" HOT 1
- [FEATURE] Windows support HOT 2
- Error: manifest not found HOT 1
- GUI not showing HOT 5
- [BUG] ImportError: cannot import name 'StringMethods' from 'pandas.core.strings' HOT 1
- [BUG] Error with dependency on pydantic >v2 needs addressing HOT 1
- [BUG] AttributeError: module 'meerkat' has no attribute 'AbstractColumn' HOT 1
- Dataframe loading fails on Colab: 'localhost refused to connect'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meerkat.