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

feat: Support one-shot prompts #26

Merged
merged 6 commits into from
Jan 21, 2024
Merged

feat: Support one-shot prompts #26

merged 6 commits into from
Jan 21, 2024

Conversation

carlosgjs
Copy link
Collaborator

This PR refactors the prompt management to add support for one-shot prediction. Specifically:

  • Adds the PromptBuilder helper class
  • Changes the prompts module to export full prompt templates, instead of separate sets of system and instruction prompts
  • Change upstream functions and tests accordingly

Test outputs from the generate.ipynb notebook:

PromptIds.AUTORA_VARS_ZEROSHOT
******* Output 0 ******** 
The dependent variable "y" is a real-valued variable, while the independent variable "x" is a continuous variable with a range of [0, 2π] and 30 allowed values. 
*************

PromptIds.AUTORA_VARS_ONESHOT
******* Output 0 ******** 
The problem is defined by one independent variable $x \in [0, 2 \pi]$ and one dependent variable $y$. 
*************

@carlosgjs carlosgjs assigned anujsinha3 and unassigned anujsinha3 Jan 19, 2024
@carlosgjs carlosgjs requested a review from anujsinha3 January 19, 2024 00:27
@carlosgjs carlosgjs marked this pull request as ready for review January 19, 2024 00:27
@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (61d2480) 96.57% compared to head (1fdb074) 97.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   96.57%   97.00%   +0.43%     
==========================================
  Files           3        3              
  Lines         146      167      +21     
==========================================
+ Hits          141      162      +21     
  Misses          5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@carlosgjs carlosgjs requested review from lsetiawan and uwcdc January 19, 2024 16:53
@lsetiawan
Copy link
Collaborator

The changes I think are good and I don't have much comment on that. I do have some thoughts on the PromptBuilder class. Is this serving almost like a template engine thing? Seems like you're trying to pack together some sort of prompt text. My thought is maybe it's worth to create some sort of prompt template say with tools like jinja so that it's easier to see what is actually getting build. At this moment, without actually running the code, I have a hard time understanding what is actually happening... Idk, what do you think?

@carlosgjs
Copy link
Collaborator Author

The changes I think are good and I don't have much comment on that. I do have some thoughts on the PromptBuilder class. Is this serving almost like a template engine thing? Seems like you're trying to pack together some sort of prompt text. My thought is maybe it's worth to create some sort of prompt template say with tools like jinja so that it's easier to see what is actually getting build. At this moment, without actually running the code, I have a hard time understanding what is actually happening... Idk, what do you think?

Didn't know about jinja and it looks pretty powerful. But perhaps its overkill for this scenario? I'm hesitant to add a package dependency for a relatively simple string building.

@carlosgjs carlosgjs requested a review from lsetiawan January 19, 2024 23:38
@lsetiawan
Copy link
Collaborator

Didn't know about jinja and it looks pretty powerful. But perhaps its overkill for this scenario? I'm hesitant to add a package dependency for a relatively simple string building.

Okay, I wasn't sure how complex these prompts may be. 😄 I do like what you did in your last commit to at least make the code more readable.

@carlosgjs carlosgjs merged commit 10294bc into main Jan 21, 2024
9 checks passed
@carlosgjs carlosgjs deleted the carlosg/prompt2 branch January 21, 2024 23:50
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.

4 participants