please add support for spacy and fastapi
please add support for spacy and fastapi
11 Replies
One Up! So atm FastAPI and spacy do not work out of the box?
They do, more detailed answer here: https://github.com/modularml/mojo/issues/766
hmm interesting. should that yield in better performance in general as well as when using cuda functions like in OCR with unstructured?
No importing Python modules this way runs through the CPython interpreter and doesn't improve performance at this stage
So Python doesn't get compiled down yet, just runs alongside in an interpreter?
What's the cost of interop between Mojo and Python right now? Similar to Python calling C?
That’s right yeah. The objects live in memory and behave in the same way they do with CPython. Same cost as Python yeah.
but is there actually interop cost, or it just gives memory addresses?
No more cost than using Python normally, e.g. you can get the memory address of a CPython numpy ndarray back and then load and store values using SIMD
at this stageI'm sure I read somewhere that Mojo is targeting improving performance on Python modules ran in Mojo. Is that why you ended your comment with that, or am I hallucinating?
Yeah I believe the end goal includes compiling Python code itself and doing static metaprogramming to achieve reflection in Python, but compiled.
Not in the short term, there are many other projects doing that. Mojo is focused on allowing you to run your hardware as close to the limits of physics as possible. But there is potential to do that later