Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Ollama Integration #63

wants to merge 2 commits into from

Conversation

osamanatouf2
Copy link

@osamanatouf2 osamanatouf2 commented Aug 6, 2023

This is current progress of ollama integration #39 into prompttools

added files

  • prompttools/prompttools/experiment/experiments/ollama/
    - 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)
  • prompttools/examples/notebooks/OllamaExperiment.ipynb(not tested and not complete)

critical issue: prompttools/requests module causes name collision and need to be changed and refactored

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Collaborator

@NivekT NivekT left a 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

Copy link
Collaborator

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\")"
Copy link
Collaborator

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.

@zifeo
Copy link

zifeo commented Dec 31, 2023

@osamanatouf2 this is a great addition, are you planning on continuing the PR?

@osamanatouf2
Copy link
Author

osamanatouf2 commented Jan 2, 2024

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
Also, I think you have module requests in the repo and that will have import collision when I import requests to talk to the API.
/prompttools/requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants