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: Added Gradio support #812

Merged
merged 3 commits into from
Nov 5, 2023
Merged

Conversation

Stillerman
Copy link
Contributor

You can start public Gradio UI by passing --gradio to the inference CLI.

accelerate launch -m axolotl.cli.inference examples/openllama-3b/config.yml --gradio

Closes #228

Copy link
Collaborator

@winglian winglian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I'll see if I can get this working locally and merge once I can validate. Thank you!

@winglian
Copy link
Collaborator

winglian commented Nov 3, 2023

@Stillerman would you be able to run pre-commit run --all-files to fix the listing issues pls?

@Stillerman
Copy link
Contributor Author

Yes I can do that by tomorrow morning

yield all_text

demo = gr.Interface(fn=generate, inputs="text", outputs="text")
demo.launch(show_api=False, share=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
demo.launch(show_api=False, share=True)
demo.queue().launch(show_api=False, share=True)

Ran into this error: ValueError: Queue needs to be enabled! You may get this error by either 1) passing a function that uses the yield keyword into an interface without enabling the queue or 2) defining an event that cancels another event without enabling the queue. Both can be solved by calling .queue() before .launch(), the above change seems to fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that it didn't show up for me... Added it anyways and also a --gradio_title param

@winglian winglian merged commit 738a057 into axolotl-ai-cloud:main Nov 5, 2023
4 checks passed
mkeoliya pushed a commit to mkeoliya/axolotl that referenced this pull request Dec 15, 2023
* Added gradio support

* queuing and title

* pre-commit run
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.

[Feat] Add gradio
2 participants