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

Unable to save model from the DSPY Example #1140

Open
sartyagi91 opened this issue Jun 12, 2024 · 6 comments
Open

Unable to save model from the DSPY Example #1140

sartyagi91 opened this issue Jun 12, 2024 · 6 comments

Comments

@sartyagi91
Copy link

sartyagi91 commented Jun 12, 2024

Hey I encountered an error when I was compiling one of the examples from the dspy library, I got an error like this "TypeError: {'Talk About a Stranger', 'Nancy Reagan'} is not JSON serializable"

link to the colab example: https://colab.research.google.com/github/stanfordnlp/dspy/blob/main/examples/longformqa/longformqa_assertions.ipynb#scrollTo=r0t33A00YzVV

@tom-doerr
Copy link
Contributor

Did you run it with default settings?
It's weird that there's a quotation mark missing after "Stranger".

@sartyagi91
Copy link
Author

Yes, I ran with default settings, But when I was saving the model using

cited_longformqa.save("FILE_NAME.json")

I encountered the error I showed above.

@tom-doerr
Copy link
Contributor

Related:
#1011
#758

@sartyagi91
Copy link
Author

Did you run it with default settings? It's weird that there's a quotation mark missing after "Stranger".

The quotation mark was there, I did not paste it correctly.
abc

@fivejjs
Copy link
Contributor

fivejjs commented Jun 14, 2024

Did you run it with default settings? It's weird that there's a quotation mark missing after "Stranger".

The quotation mark was there, I did not paste it correctly. abc

It looks like the proper json object: {"some key": "values"}. But yours looks like Python set.

@okhat
Copy link
Collaborator

okhat commented Jun 22, 2024

The examples contain sets. They should tuples or lists. That will fix it.

We can make this change in the HotPotQA class.

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

No branches or pull requests

4 participants