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

[easy] Set Gemini model parser id to the model id being used #1139

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

Ankush-lastmile
Copy link
Member

@Ankush-lastmile Ankush-lastmile commented Feb 5, 2024

[easy] Set Gemini model parser id to the model id being used

title


Stack created with Sapling. Best reviewed with ReviewStack.

Ankush Pala ankush@lastmileai.dev added 2 commits February 5, 2024 17:51
Gemini api under the hood saves a reference to the async event loop. This messes with the local editor because we create a new event loop on api/run.

This diff reinitializes the "client" at the run step for the Gemini model parser. I put client in quotes because its not called a client but its analogous to the openai client abstraction.

## Testplan

Run a gemini prompt twice inside local editor.
Before:
<img width="1598" alt="Screenshot 2024-02-05 at 5 36 26 PM" src="https://github.com/lastmile-ai/gradio-workbook/assets/141073967/5ed779f4-61b2-4595-a34c-11992a2c055c">

After:
run twice, no event loop error
https://github.com/lastmile-ai/gradio-workbook/assets/141073967/39d1d4b2-90c5-4ee1-b1a4-bc35d8528d60
added comment

Co-authored-by: Sarmad Qadri <sarmad.qadri@outlook.com>
@Ankush-lastmile Ankush-lastmile merged commit 17d67a0 into main Feb 5, 2024
1 check passed
@rossdanlm rossdanlm deleted the pr1139 branch February 6, 2024 23:17
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.

2 participants