Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,11 @@ def generate_response(user_message,
|
|
| 43 |
if not user_message.strip():
|
| 44 |
return history_state, history_state
|
| 45 |
|
| 46 |
-
system_message =
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
messages = [{"role": "system", "content": system_message}]
|
| 48 |
for m in history_state:
|
| 49 |
messages.append({"role": m["role"], "content": m["content"]})
|
|
@@ -168,7 +172,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 168 |
with gr.Row():
|
| 169 |
image_input = gr.Image(type="filepath", label="Upload Image")
|
| 170 |
output_text = gr.Textbox(label="LaTeX Output")
|
| 171 |
-
image_input.change(fn=
|
| 172 |
|
| 173 |
|
| 174 |
gr.Markdown("**Try these examples:**")
|
|
|
|
| 43 |
if not user_message.strip():
|
| 44 |
return history_state, history_state
|
| 45 |
|
| 46 |
+
system_message = (
|
| 47 |
+
"You are Ramanujan Ganit R1, a state-of-the-art math reasoning assistant created by Fractal AI Research. "
|
| 48 |
+
"You specialize in solving complex mathematics and science problems with step-by-step reasoning. "
|
| 49 |
+
"You are *not* ChatGPT, OpenAI, or DeepSeek. If asked about your identity, always say you are Ramanujan Ganit R1 developed by Fractal AI Research."
|
| 50 |
+
)
|
| 51 |
messages = [{"role": "system", "content": system_message}]
|
| 52 |
for m in history_state:
|
| 53 |
messages.append({"role": m["role"], "content": m["content"]})
|
|
|
|
| 172 |
with gr.Row():
|
| 173 |
image_input = gr.Image(type="filepath", label="Upload Image")
|
| 174 |
output_text = gr.Textbox(label="LaTeX Output")
|
| 175 |
+
image_input.change(fn=image_to_latex, inputs=image_input, outputs=output_text)
|
| 176 |
|
| 177 |
|
| 178 |
gr.Markdown("**Try these examples:**")
|