Tonic commited on
Commit
582c792
·
verified ·
1 Parent(s): 3866751

add goedel's prover

Browse files
Files changed (1) hide show
  1. app.py +16 -5
app.py CHANGED
@@ -119,11 +119,18 @@ examples = [
119
  [unimath4, additional_info_prompt, 1200]
120
  ]
121
 
122
- model_name = "deepseek-ai/deepseek-math-7b-instruct"
123
  tokenizer = AutoTokenizer.from_pretrained(model_name)
124
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
 
 
 
 
125
  model.generation_config = GenerationConfig.from_pretrained(model_name)
126
  model.generation_config.pad_token_id = model.generation_config.eos_token_id
 
 
 
127
 
128
  def parse_full_answer(answer):
129
  """Parses the assistant's answer, excluding any text before 'Assistant :'."""
@@ -148,10 +155,14 @@ def solve_math_problem(question, additional_info, max_tokens):
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),
 
119
  [unimath4, additional_info_prompt, 1200]
120
  ]
121
 
122
+ model_name = "Goedel-LM/Goedel-Prover-SFT"
123
  tokenizer = AutoTokenizer.from_pretrained(model_name)
124
  model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
125
+ # model.generation_config = GenerationConfig.from_pretrained(model_name)
126
+ # model.generation_config.pad_token_id = model.generation_config.eos_token_id
127
+
128
+ # Set generation config
129
  model.generation_config = GenerationConfig.from_pretrained(model_name)
130
  model.generation_config.pad_token_id = model.generation_config.eos_token_id
131
+ model.generation_config.bos_token_id = 100000
132
+ model.generation_config.eos_token_id = 100001
133
+
134
 
135
  def parse_full_answer(answer):
136
  """Parses the assistant's answer, excluding any text before 'Assistant :'."""
 
155
 
156
  def main():
157
  iface = gr.Interface(
158
+ title="# 🙋🏻‍♂️Welcome to🌟Tonic's🔮Goedel Prover📉",
159
+ description="""You can build with this endpoint using🔮Goedel-Prover-SFT📉 available here : [Goedel-LM/Goedel-Prover-SFT](https://huggingface.co/Goedel-LM/Goedel-Prover-SFT). 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 !
160
+ You can also use 🔮Goedel Prover📉 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>
161
+ 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 🤗
162
+ """,
163
+
164
+
165
+
166
  fn=solve_math_problem,
167
  outputs=[
168
  gr.Code(label="🔮TonicsMathAssistant📉", interactive=False),