Spaces:
basit123796
/
Runtime error

Tonic commited on
Commit
846298d
1 Parent(s): e7353da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -27
app.py CHANGED
@@ -113,10 +113,10 @@ TcDebug (0) > NONE??? LtacNotationCall (no location),/mnt/data1/2024/01/05/UniMa
113
  # source : unimath/unimath/batch2/data_42/BATCH142042
114
 
115
  examples = [
116
- (unimath1, additional_info_prompt),
117
- (unimath2, additional_info_prompt),
118
- (unimath3, additional_info_prompt),
119
- (unimath4, additional_info_prompt),
120
  ]
121
 
122
  model_name = "deepseek-ai/deepseek-math-7b-instruct"
@@ -147,29 +147,26 @@ def solve_math_problem(question, additional_info, max_tokens):
147
 
148
 
149
  def main():
150
- with gr.Blocks() as demo:
151
- gr.Markdown(title)
152
- question_field = gr.Code(language='python', label="🤔Enter your math problem")
153
- additional_info_field = gr.Text(value=additional_info_prompt, label="🪜Optional train-of-thought")
154
- max_tokens = gr.Slider(minimum=150, maximum=1200, value=250, label="🪙Max Tokens")
155
- submit_button = gr.Button("📉Solve")
156
- full_answer_output = gr.Code(label="🔮TonicsMathAssistant📉", interactive=False)
157
- final_answer_output = gr.Textbox(label="Final Answer")
158
-
159
- example_index = gr.Number(label="Example Index", visible=False)
160
-
161
- def set_example(index):
162
- examples = [unimath1, unimath2, unimath3, unimath4]
163
- question = examples[int(index)]
164
- additional_info = additional_info_prompt
165
- return question, additional_info
166
-
167
- with gr.Row():
168
- with gr.Accordion("🤖 UniMath Examples", open=False):
169
- for i, example in enumerate(examples, start=1):
170
- gr.Markdown(f"**Example {i}:**\n```{example[0]}```")
171
-
172
- demo.launch(examples=examples)
173
 
174
  if __name__ == "__main__":
175
  main()
 
113
  # source : unimath/unimath/batch2/data_42/BATCH142042
114
 
115
  examples = [
116
+ [unimath1, additional_info_prompt, 1200],
117
+ [unimath2, additional_info_prompt, 1200],
118
+ [unimath3, additional_info_prompt, 1200],
119
+ [unimath4, additional_info_prompt, 1200]
120
  ]
121
 
122
  model_name = "deepseek-ai/deepseek-math-7b-instruct"
 
147
 
148
 
149
  def main():
150
+ iface = gr.Interface(
151
+ title="👋🏻Welcome to🌟Tonic's 🔮DeepSeekMath📉",
152
+ 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 !
153
+ 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>
154
+ Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's 🛠️community 👻 [![Join us on Discord](https://img.shields.io/discord/1109943800132010065?label=Discord&logo=discord&style=flat-square)](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 🤗""",
155
+ fn=solve_math_problem,
156
+ outputs=[
157
+ gr.Code(label="🔮TonicsMathAssistant📉", interactive=False),
158
+ gr.Textbox(label="Final Answer")
159
+ ]
160
+ inputs=[
161
+ gr.Textbox(label="🤔Enter your math problem", lines=7),
162
+ gr.Textbox(default=additional_info_prompt, label="🪜Optional train-of-thought"),
163
+ gr.Slider(minimum=150, maximum=1200, default=250, label="🪙Max Tokens")
164
+ ],
165
+
166
+ examples=examples
167
+ )
168
+
169
+ iface.launch()
 
 
 
170
 
171
  if __name__ == "__main__":
172
  main()