Modular

M

Modular

This server is the home of the MAX and Mojo community. Join us to chat about all things Modular!

Join

questions

community-showcase

Distinction Between map, parallelize and sync_parallelize

Trying to read the docs to see which one to use, but parallelize and sync_parallelize has the same function signature for the first overload function. Also, map has the same. What is the difference between those functions?

ARM support

Can magic support ARM. I aware officially it is supporting Ubuntu and Mac, but it had been installed and run with me at Arch and Fedora. I tried today installing it at Android Termux, but got the below error, which I guess is related to using ARM ...
No description

How to solve failed to solve the pypi requirements?

After install magic, I try to add pypi dependencies but I've got the error. How can I solve this error? #magic-cli...
No description

Assigning additional traits to Variants

Is there a way to assign a trait to the Variant type? I'm specifically trying to use the __str__ method with List[Variant[types..]] specifically.

Linux Mint.

How may I install Max and Mojo in Linux Mint?

More details on `TaskGroup` and async

Hi @Caroline @Jack Clayton , are there any details avaialble on the implementation and/or usage of the TaskGroup or on how to use async/schedule tasks to run concurrently in Mojo at the moment? The only example I found is this explanation by Jack https://discord.com/channels/1087530497313357884/1276206591510843443/1276210757792436234 , wondering if y'all can provide more insights? E.g. is it possible to await tasks one by one and not the whole group at once?...

"Linking" structs together?

I'm not talking about inheritance from other structs, but is there a way to refer to other structs as well when referring to one of them? For example: ```python var thing = MyStruct() var other_thing = MyOtherStruct() var list_of_things = List[MyStruct](thing, other_thing) # this is valid code since MyOtherStruct is linked to MyStruct...

Is there a Struct type or something similar?

I'm trying to create a Set / List which can hold structs, but I'm not sure how to initialise this sort of type.

looking for spec recommendations for provisioning MAX on RHEL8 using an 8GB VRAM A100 #MAX

This project will run whisper and LLAMA 3.1 FLASK and MySQL Speed is #1 objective. Transcribing wave audio and summarizing with LLM. ...

What does the keyword `capturing` do?

I noticed that the keyword capturing is necessary when I want to time code via time_function. For example, ```mojo from time import time_function fn closure() capturing:...

How to define nested dict function

(This is a shortened cross post of my stackoverflow question). How do I define a function in Mojo where the argument or return value is a nested structure, like a dictionary. But where the exact structure is not known at compile time because, for example, it is read from disk. For example, how do I type annotate params in the function neural_network to represent a nested dict to keep the model parameters (i.e., a pytree)....

Creating a mojo version of Tauri(Rust)/Wails(Go) that integrates Webview?

Is anyone interested in creating a mojo version of Tauri(Rust)/Wails(Go) that integrates Webview? - https://github.com/r0x0r/pywebview...

permission denied using `magic run`

magic run server.mojo
Error launching 'server.mojo': Permission denied (os error 13)
magic run server.mojo
Error launching 'server.mojo': Permission denied (os error 13)
...

How can I use a fixed-size integer type to index a list?

I want to use a fixed-size integer value as index of a list. However, I get the "no matching method in call to 'getitem'" error. ```mojo var l: List[Int] = ListInt l.append(1) var ind: UInt32 = 0...

Using the .append() method on structs

I have the following code: ```python alias Component = fn() -> None fn baseComponent(): pass...

Compile to Shared Library

Can I compile mojo code as a shared library,? If yes, how?

Int64 doesn't implement EqualityComparableCollectionElement?

If I change this code https://github.com/py2many/py2many/blob/main/tests/expected/bubble_sort.mojo to use List[Int64] it errors out with the above message. Known problem?...

parallelize and @parameter issue in Mojo 24.5

I am trying to convert my projects to Mojo 24.5. Right now I face the following issue. When running ```rust...

Define Tuple with PuthonObject

Trying to convert the below opencv python code to mojolang: ```python import cv2 as cv cap = cv.VideoCapture(0)...