Spaces:
Runtime error
Runtime error
Update app.py
Browse files112 unmodified lines11311411511611711811912012112224 unmodified lines147148149150151152153154155156157158159160161162163164165166167168169170171172173174175112 unmodified lines# source : unimath/unimath/batch2/data_42/BATCH142042examples = [(unimath1, additional_info_prompt),(unimath2, additional_info_prompt),(unimath3, additional_info_prompt),(unimath4, additional_info_prompt),]model_name = "deepseek-ai/deepseek-math-7b-instruct"24 unmodified linesdef main():with gr.Blocks() as demo:gr.Markdown(title)question_field = gr.Code(language='python', label="🤔Enter your math problem")additional_info_field = gr.Text(value=additional_info_prompt, label="🪜Optional train-of-thought")max_tokens = gr.Slider(minimum=150, maximum=1200, value=250, label="🪙Max Tokens")submit_button = gr.Button("📉Solve")full_answer_output = gr.Code(label="🔮TonicsMathAssistant📉", interactive=False)final_answer_output = gr.Textbox(label="Final Answer")example_index = gr.Number(label="Example Index", visible=False)def set_example(index):examples = [unimath1, unimath2, unimath3, unimath4]question = examples[int(index)]additional_info = additional_info_promptreturn question, additional_infowith gr.Row():with gr.Accordion("🤖 UniMath Examples", open=False):for i, example in enumerate(examples, start=1):gr.Markdown(f"**Example {i}:**\n```{example[0]}```")demo.launch(examples=examples)if __name__ == "__main__":main()112 unmodified lines11311411511611711811912012112224 unmodified lines147148149150151152153154155156157158159160161162163164165166167168169170171172112 unmodified lines# source : unimath/unimath/batch2/data_42/BATCH142042examples = [[unimath1, additional_info_prompt, 1200],[unimath2, additional_info_prompt, 1200],[unimath3, additional_info_prompt, 1200],[unimath4, additional_info_prompt, 1200]]model_name = "deepseek-ai/deepseek-math-7b-instruct"24 unmodified linesdef main():iface = gr.Interface(title="👋🏻Welcome to🌟Tonic's 🔮DeepSeekMath📉",description="""You can build with this endpoint using🔮DeepSeekMath📉 available here : [deepseek-ai/deepseek-math-7b-instruct](https://huggingface.co/deepseek-ai/deepseek-math-7b-instruct). We're using 🤖[introspector/unimath](https://huggingface.co/datasets/introspector/unimath) for cool examples, check it out below ! The demo is still a work in progress and we're looking forward to build downstream tasks that showcase outstanding mathematical reasoning. Have any ideas ? join us below !You can also use 🔮DeepSeekMath📉 by cloning this space. Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/Tonic/Math?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's 🛠️community 👻 [](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) Math with [introspector](https://huggingface.co/introspector) On 🌐Github: [Tonic-AI](https://github.com/tonic-ai) & contribute to🌟 [SciTonic](https://github.com/Tonic-AI/scitonic)🤗Big thanks to Yuvi Sharma and all the folks at huggingface for the community grant 🤗""",fn=solve_math_problem,outputs=[gr.Code(label="🔮TonicsMathAssistant📉", interactive=False),gr.Textbox(label="Final Answer")]inputs=[gr.Textbox(label="🤔Enter your math problem", lines=7),gr.Textbox(default=additional_info_prompt, label="🪜Optional train-of-thought"),gr.Slider(minimum=150, maximum=1200, default=250, label="🪙Max Tokens")],examples=examples)iface.launch()if __name__ == "__main__":main()
app.py+24-27