-
Notifications
You must be signed in to change notification settings - Fork 234
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
Ollama Integration #63
base: main
Are you sure you want to change the base?
Conversation
|
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.
Hi,
Thank you for opening this PR. We just recently refactored how Experiment
results are saved and how experiment.evaluate()
work.
I added inline comments to walk through the necessary changes. Please let me know if there is any question.
if len(self.results) == 0: | ||
logging.error("No results. Something went wrong.") | ||
raise PromptExperimentException | ||
|
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.
To save the results, you want to call _construct_result_dfs(...)
here.
See this updated source code.
}, | ||
"outputs": [], | ||
"source": [ | ||
"experiment.evaluate(\"similar_to_expected\", similarity.evaluate, expected=\"George Washington\")" |
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.
We made some changes to how .evaluate()
work.
You likely want:
from prompttools.utils import semantic_similarity
experiment.evaluate("similar_to_expected", semantic_similarity, expected=["George Washington"] * n) # Replace `n` with the number of rows
See this updated example.
@osamanatouf2 this is a great addition, are you planning on continuing the PR? |
Yes, I am. I just got distracted with some personal stuff for the past 6 month. If you want to help that would be great @zifeo |
This is current progress of ollama integration #39 into prompttools
added files
- Dockerfile: build image for ollama server to use locally(tested)
- ollama_api.py: handle the api calls to ollama server(tested).
-prompttools/prompttools/experiment/experiments/ollama_experiment.py(not tested, I think it works)
critical issue: prompttools/requests module causes name collision and need to be changed and refactored