-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ragas_once pip package #513
Conversation
d6ff9ff
to
43e9bac
Compare
@Lanture1064 We should make this python code as a python project and publish package to pypl. Please refer to https://packaging.python.org/en/latest/tutorials/packaging-projects/ |
7a5f542
to
34de7d8
Compare
db70444
to
d195808
Compare
aa0fb94
to
4d22133
Compare
import pandas as pd | ||
|
||
# Initialize an empty dataset | ||
dataset = pd.DataFrame(columns=['question', 'answer', 'ground_truths']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lanture1064 How about the contexts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function has been replaced by
data = pd.read_csv(dataset)
data['ground_truths'] = data['ground_truths'].apply(lambda x: x.split(';'))
data['contexts'] = data['contexts'].apply(lambda x: x.split(';'))
test_set = Dataset.from_pandas(data)
in cli.py
.
dataset.at[index, 'ground_truths'] = [row['ground_truths']] # Convert single string to list | ||
|
||
# Print the dataset | ||
print(dataset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not need to print
8f9a2a5
to
2774b5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my comments .
long_description = f.read() | ||
|
||
setup( | ||
name="raga_once", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good name ! maybe ragas_once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep the direcotyr name save as your project name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the raga-once
has been uploaded, I'm not sure if pypi supports changing the name of it
os.environ["OPENAI_API_KEY"] = api_key | ||
os.environ["OPENAI_API_BASE"] = api_base | ||
base = ChatOpenAI( | ||
model_name=model, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you already have this name configured in ChatOpenAI
, can we remove `os.environ'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ragas lib reaches out to os.environ
as default, so this is rather like an 'insurance'? We can remove it tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's give this file another name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe wrapper.py?
bb8fe69
to
1b9740e
Compare
93f00c7
to
e83e1ef
Compare
a328a59
to
ad39162
Compare
d3d90d1
to
0be9eb1
Compare
pypi/ragas_once/setup.py
Outdated
long_description = f.read() | ||
|
||
setup( | ||
name="raga-once", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ragas-once or ragas_once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pypi package name is raga-once, while python subdir name is ragas_once since python requires it. (e.g. python can only read import ragas_once.cli as pkg
, but not import ragas-once.cli as pkg
a0ef8a7
to
768d80c
Compare
|
||
```bash | ||
pip install ragas langchain==0.0.354 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this dependency???
pypi/ragas_once/README.md
Outdated
|
||
```bash | ||
python3 -m ragasonce --api_key "YOUR_OPENAI_API_KEY" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ragasonce ???? maybe regas_once or ragas-once? please keep consistent .
d824d4e
to
aecdd52
Compare
What type of PR is this?
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer