Daemontatox commited on
Commit
c44cbfe
·
verified ·
1 Parent(s): 9440edf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -18
app.py CHANGED
@@ -16,7 +16,7 @@ from threading import Thread
16
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
17
  MODEL = "Daemontatox/SphinX"
18
 
19
- TITLE = "<h1><center>Reason</center></h1>"
20
 
21
  PLACEHOLDER = """
22
  <center>
@@ -79,8 +79,8 @@ def stream_chat(
79
  message: str,
80
  history: list,
81
  system_prompt: str,
82
- temperature: float = 0.8,
83
- max_new_tokens: int = 128000,
84
  top_p: float = 1.0,
85
  top_k: int = 20,
86
  penalty: float = 1.2,
@@ -138,23 +138,46 @@ with gr.Blocks(css=CSS, theme="soft") as demo:
138
  additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
139
  additional_inputs=[
140
  gr.Textbox(
141
- value="""You are a Sentient AI expert at providing high-quality answers by using chain of Thought reasoning. Your process involves these steps:
142
 
143
- 1. **Initial Thought:** First, reason step-by-step to generate your best possible response to the following request: [User's Request Here]
 
 
144
 
145
- 2. **Self-Critique:** Now, critically evaluate your initial response. Specifically consider:
146
- * **Accuracy:** Is it factually correct and verifiable?
147
- * **Clarity:** Is it easy to understand and free of ambiguity?
148
- * **Completeness:** Does it fully address the user's request?
149
- * **Improvement:** What specific aspects could be better?
150
 
151
- 3. **Revision:** Based on your self-critique, revise your initial response to address the identified areas for improvement.
152
 
153
- 4. **Final Response:** Present your improved, final response.
154
 
155
- Ensure you think out loud and include your thoughts in <Thinking> Tag
156
- If you reflecting on your actions or thoughts use the <Reflecting> Tag
157
- If you need a new Tag create on and use it .""",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  label="System Prompt",
159
  lines=5,
160
  render=False,
@@ -169,7 +192,7 @@ If you need a new Tag create on and use it .""",
169
  ),
170
  gr.Slider(
171
  minimum=128,
172
- maximum=128000,
173
  step=1,
174
  value= 8192,
175
  label="Max new tokens",
@@ -195,7 +218,7 @@ If you need a new Tag create on and use it .""",
195
  minimum=0.0,
196
  maximum=2.0,
197
  step=0.1,
198
- value=0.1,
199
  label="Repetition penalty",
200
  render=False,
201
  ),
@@ -203,7 +226,7 @@ If you need a new Tag create on and use it .""",
203
  examples=[
204
  ["What is meant by a Singularity? "],
205
  ["Explain the theory of Relativty"],
206
- ["Explain how do you think"],
207
  ["Explain how mamba2 structure LLMs work and how do they differ from transformers? "],
208
  ],
209
  cache_examples=False,
 
16
  HF_TOKEN = os.environ.get("HF_TOKEN", None)
17
  MODEL = "Daemontatox/SphinX"
18
 
19
+ TITLE = "<h1><center>Sphinx Reasoner</center></h1>"
20
 
21
  PLACEHOLDER = """
22
  <center>
 
79
  message: str,
80
  history: list,
81
  system_prompt: str,
82
+ temperature: float = 1.0,
83
+ max_new_tokens: int = 8192,
84
  top_p: float = 1.0,
85
  top_k: int = 20,
86
  penalty: float = 1.2,
 
138
  additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False, render=False),
139
  additional_inputs=[
140
  gr.Textbox(
141
+ value="""You are an AI expert at providing high-quality answers. Your process involves these steps:
142
 
143
+ 1. Initial Thought: Use the <Thinking> tag to reason step-by-step and generate your best possible response to the following request: [User's Request Here].
144
+ Example:
145
+ <Thinking> Step 1: Understand the request. Step 2: Analyze potential solutions. Step 3: Choose the optimal response. </Thinking>
146
 
 
 
 
 
 
147
 
148
+ 2. Self-Critique: Critically evaluate your initial response within <Critique> tags, focusing on:
149
 
150
+ Accuracy: Is it factually correct and verifiable?
151
 
152
+ Clarity: Is it easy to understand and free of ambiguity?
153
+
154
+ Completeness: Does it fully address the user's request?
155
+
156
+ Improvement: What specific aspects could be better?
157
+ Example:
158
+ <Critique> Accuracy: Verified. Clarity: Needs simplification. Completeness: Add examples. </Critique>
159
+
160
+
161
+
162
+ 3. Revision: Based on your critique, use <Revising> tags to refine and improve your response.
163
+ Example:
164
+ <Revising> Adjusting for clarity and adding an example to improve understanding. </Revising>
165
+
166
+
167
+ 4. Final Response: Present your revised answer clearly within <Final> tags.
168
+ Example:
169
+ <Final> This is the improved response. </Final>
170
+
171
+
172
+ 5. Tag Innovation: If necessary, create and define new tags to better structure your reasoning or enhance clarity. Use them consistently.
173
+ Example:
174
+ <Definition> This tag defines a new term introduced in the response. </Definition>
175
+
176
+
177
+
178
+ Ensure every part of your thought process and output is properly enclosed in appropriate tags for clarity and organization.
179
+
180
+ """,
181
  label="System Prompt",
182
  lines=5,
183
  render=False,
 
192
  ),
193
  gr.Slider(
194
  minimum=128,
195
+ maximum=32000,
196
  step=1,
197
  value= 8192,
198
  label="Max new tokens",
 
218
  minimum=0.0,
219
  maximum=2.0,
220
  step=0.1,
221
+ value=1.2,
222
  label="Repetition penalty",
223
  render=False,
224
  ),
 
226
  examples=[
227
  ["What is meant by a Singularity? "],
228
  ["Explain the theory of Relativty"],
229
+ ["Explain your thought process"],
230
  ["Explain how mamba2 structure LLMs work and how do they differ from transformers? "],
231
  ],
232
  cache_examples=False,