Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better display of mathamatical functions. #272

Open
olumolu opened this issue Sep 2, 2024 · 9 comments
Open

better display of mathamatical functions. #272

olumolu opened this issue Sep 2, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@olumolu
Copy link
Contributor

olumolu commented Sep 2, 2024

∫u dv = uv - ∫v du
|1 0|
|0 1|
∆/∆x

sin²(θ)
______ = cot²(θ)
cos²(θ)

New models have a better mathematical skills so having better support for natural display of integration differential calculus matrix aSummation amd others

@olumolu olumolu added the enhancement New feature or request label Sep 2, 2024
@Jeffser
Copy link
Owner

Jeffser commented Sep 2, 2024

This would involve implementing a Latex to SVG converter since the GTK Label can't display complex mathematical equations, I mean, it wouldn't be easy but it's not impossible

@olumolu
Copy link
Contributor Author

olumolu commented Sep 2, 2024

This would involve implementing a Latex to SVG converter since the GTK Label can't display complex mathematical equations, I mean, it wouldn't be easy but it's not impossible

Sure now i was looking for the new models and testing its mathematical ability i find this models are good.
They are even able to solve hard infinite series, harmonic func, calculas like integration with partial integration even integration with respect to constant variables, beta gemma function and matrix.
This are the stuff i have tested.
Other basic maths and pure maths need to be tested.

@olumolu
Copy link
Contributor Author

olumolu commented Sep 12, 2024

I am waiting for this feature so we can actually ask maths to this. If this can be the next feature.

@Jeffser
Copy link
Owner

Jeffser commented Sep 12, 2024

my guy, it's not that simple, just be patient

@olumolu
Copy link
Contributor Author

olumolu commented Sep 12, 2024

my guy, it's not that simple, just be patient

I know that this is not that simple and it is really good if you start work after basic issues got solved like crash or gpu not using and so on.

@olumolu
Copy link
Contributor Author

olumolu commented Dec 19, 2024

This is something that can be looked into now as the app is in a good state now and models mathematical problem solving skills are even better... You can use llama3.2 90B as a maths tutor now. I have tested with 11B and i find it has exceptional mathematical reasoning power like gpt 4o.

@Jeffser
Copy link
Owner

Jeffser commented Jan 5, 2025

What up, it's been a couple of months but I have an update.

So, apparently LaTeX is quite the complex thing.

I added matplotlib as a dependency, with that I can do the following:

  1. Render a "simple LaTeX equation" into a PNG in a tempfolder
  2. Load the image
  3. Crop the image so that it doesn't have any padding
  4. Load the image into a button in Alpaca's interface

Now, all of that sounds simple, problem is, matplotlib doesn't include all of LaTeX, so not everything will work, as far as I can see it struggles with matrix and multiline rendering.

Now, I added a check so if LaTeX is available in the system it uses that to fully render whatever, there's even an extension for it in Flathub!

So now you might be asking, why couldn't we add LaTeX itself or the extension as a dependency? The answer is quite simple, you see, it's 5 GIGABYTES.

I ain't doing that.

Now there was another alternative I considered, adding WebKitGtk so I could render a small website with JS rendering LaTeX, the problem with that is that I would have to build Alpaca along with a browser, so nope, not doing that.

Anyways, it works with simple stuff, I suspect most people will only use it with small formulas, I will consider adding the LaTeX extension as an optional thing in Flatpak, I don't know what I'm going to do with MacOS and Snap though

image

@Jeffser
Copy link
Owner

Jeffser commented Jan 5, 2025

It fails sometimes and renders a blank image, I added a button to regenerate (and copy) an equation

image

@Jeffser
Copy link
Owner

Jeffser commented Jan 5, 2025

It can also display syntax errors by parsing them to the button's tooltip_text

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants