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

Still seems to work nicely with mlx 0.15, but not with 0.21 #12

Open
jrp2014 opened this issue Dec 1, 2024 · 0 comments
Open

Still seems to work nicely with mlx 0.15, but not with 0.21 #12

jrp2014 opened this issue Dec 1, 2024 · 0 comments

Comments

@jrp2014
Copy link

jrp2014 commented Dec 1, 2024

Thanks for putting this package together. It should have more prominence on the mlx repo.

It seems to work OK with mlx 0.15.

 % python test.py 
Fetching 9 files: 100%|████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 97040.45it/s]
Fetching 10 files: 100%|█████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 40960.00it/s]
Downloading readme: 100%|██████████████████████████████████████████████████████████| 1.24k/1.24k [00:00<00:00, 3.69MB/s]
Downloading data: 100%|████████████████████████████████████████████████████████████| 15.4M/15.4M [00:03<00:00, 4.18MB/s]
Generating train split: 100%|██████████████████████████████████████████| 10161/10161 [00:00<00:00, 231263.11 examples/s]
/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/datasets/utils/_dill.py:379: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
  obj.co_lnotab,  # for < python 3.10 [not counted in args]
Map: 100%|████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 791.30 examples/s]
- Step loss at step 1: 2.45
- Step loss at step 2: 2.44
- Step loss at step 3: 2.39
Avg loss at step 3: 2.43
- Step loss at step 4: 2.50
Training log saved to tmp/models/phi3_v_Q
Total training time: 2.11 seconds
.gitattributes: 100%|██████████████████████████████████████████████████████████████| 1.52k/1.52k [00:00<00:00, 3.90MB/s]
config.json: 100%|█████████████████████████████████████████████████████████████████████| 226/226 [00:00<00:00, 1.87MB/s]
README.md: 100%|███████████████████████████████████████████████████████████████████████| 223/223 [00:00<00:00, 2.69MB/s]
model.npz: 100%|███████████████████████████████████████████████████████████████████| 1.34G/1.34G [04:38<00:00, 4.82MB/s]
Fetching 4 files: 100%|███████████████████████████████████████████████████████████████████| 4/4 [04:38<00:00, 69.71s/it]
1_Pooling/config.json: 100%|████████████████████████████████████████████████████████████| 191/191 [00:00<00:00, 494kB/s]
onnx/tokenizer_config.json: 100%|██████████████████████████████████████████████████████| 342/342 [00:00<00:00, 2.23MB/s]
config.json: 100%|█████████████████████████████████████████████████████████████████████| 619/619 [00:00<00:00, 4.12MB/s]
onnx/config.json: 100%|████████████████████████████████████████████████████████████████| 632/632 [00:00<00:00, 3.85MB/s]
modules.json: 100%|████████████████████████████████████████████████████████████████████| 385/385 [00:00<00:00, 2.30MB/s]
onnx/special_tokens_map.json: 100%|████████████████████████████████████████████████████| 125/125 [00:00<00:00, 1.37MB/s]
sentence_bert_config.json: 100%|██████████████████████████████████████████████████████| 57.0/57.0 [00:00<00:00, 160kB/s]
special_tokens_map.json: 100%|██████████████████████████████████████████████████████████| 125/125 [00:00<00:00, 484kB/s]
tokenizer_config.json: 100%|████████████████████████████████████████████████████████████| 342/342 [00:00<00:00, 681kB/s]
onnx/tokenizer.json: 100%|███████████████████████████████████████████████████████████| 712k/712k [00:00<00:00, 1.30MB/s]
vocab.txt: 100%|██████████████████████████████████████████████████████████████████████| 232k/232k [00:00<00:00, 694kB/s]
tokenizer.json: 100%|████████████████████████████████████████████████████████████████| 712k/712k [00:00<00:00, 1.06MB/s]
Fetching 12 files: 100%|████████████████████████████████████████████████████████████████| 12/12 [00:01<00:00,  7.42it/s]
*** Obtained API Codes ***███████████████████████████████████████████████████████████| 712k/712k [00:00<00:00, 1.06MB/s]
Text to image
```python
from gradio_client import Client
client = Client("stabilityai/stable-diffusion-3-medium")
result = client.predict(
		prompt="A perfectly red apple, 32k HDR, studio lighting",
		negative_prompt="ugly, low quality",
		seed=0,
		randomize_seed=True,
		width=1024,
		height=1024,
		guidance_scale=5,
		num_inference_steps=28,
		api_name="/infer"
)
print('<|api_output|>'+result[0])

*** Execution ***
from gradio_client import Client
client = Client("stabilityai/stable-diffusion-3-medium")
result = client.predict(
prompt="A perfectly red apple, 32k HDR, studio lighting",
negative_prompt="ugly, low quality",
seed=0,
randomize_seed=True,
width=1024,
height=1024,
guidance_scale=5,
num_inference_steps=28,
api_name="/infer"
)
print('<|api_output|>'+result[0])
0_0_image.webp
Loaded as API: https://stabilityai-stable-diffusion-3-medium.hf.space
<|api_output|>/private/var/folders/zz/w0sl16d56b9b4j70dx9pwwj80000gn/T/gradio/bcc103983600b58164f49d7985a417501182b442b05cfd60e9773d298e8351ef/image.webp
None
*** Obtained API Codes ***
Text to speech

from gradio_client import Client
client = Client("parler-tts/parler_tts_mini")
result = client.predict(
        text="People say nothing is impossible, but I do nothing every day.",
        description="",
        api_name="/gen_tts"
)
print('<|api_output|>'+result)

*** Execution ***
from gradio_client import Client
client = Client("parler-tts/parler_tts_mini")
result = client.predict(
text="People say nothing is impossible, but I do nothing every day.",
description="",
api_name="/gen_tts"
)
print('<|api_output|>'+result)
0_0_audio.wav
Loaded as API: https://parler-tts-parler-tts.hf.space
<|api_output|>/private/var/folders/zz/w0sl16d56b9b4j70dx9pwwj80000gn/T/gradio/1b14a52e6e6e15597478ed352e8c5a8a9a81e0cccf9d45155b88ffce2890a7ea/audio.wav
None
.adapters/phi3_v
/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/datasets/utils/_dill.py:379: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
obj.co_lnotab, # for < python 3.10 [not counted in args]
Map: 100%|████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 331.12 examples/s]

  • Step loss at step 1: 1.04
    Avg loss at step 1: 1.04
    Training log saved to adapters/phi3_v
    Total training time: 0.39 seconds
    adapters/phi3_v_Q
  • Step loss at step 1: 1.17
    Avg loss at step 1: 1.17
    Training log saved to adapters/phi3_v_Q
    Total training time: 0.20 seconds
    adapters/phi3_mini_128k
  • Step loss at step 1: 1.89
    Avg loss at step 1: 1.89
    Training log saved to adapters/phi3_mini_128k
    Total training time: 0.20 seconds
    adapters/phi3_mini_128k_Q
  • Step loss at step 1: 1.83
    Avg loss at step 1: 1.83
    Training log saved to adapters/phi3_mini_128k_Q
    Total training time: 0.18 seconds
    *** Prompt ***
    <|user|>
    Write a mystery horror.<|end|>
    <|assistant|>
    *** Images ***
    None
    *** Output ***
    The night was dark and full of terror as the group of friends made their way through the dense forest. They had been hiking for hours, and the only light came from the flashlights they carried. As they walked, they heard strange noises coming from the trees, and they couldn't shake the feeling that they were being watched.

Suddenly, they came across a small clearing, and in the center was a strange, glowing orb.

Prompt: 66.56 tokens-per-sec (13 tokens / 0.2 sec)
Generate: 41.24 tokens-per-sec (100 tokens / 2.4 sec)
*** Prompt ***
<|user|>
<|image_1|>
What is shown in this image?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x601C11AC0>
*** Output ***
The image depicts a historical scene with various elements such as buildings, people, and boats. There are structures that resemble a fort or castle, a large building that could be a barracks or a similar institution, and several boats on the water, some of which appear to be sailing ships. There are also people engaged in various activities, some on horseback, and others walking or standing.<|end|>

Prompt: 960.38 tokens-per-sec (1939 tokens / 2.0 sec)
Generate: 36.51 tokens-per-sec (84 tokens / 2.3 sec)
*** Prompt ***
<|user|>
Write an executive summary for a communications business plan<|end|>
<|assistant|>
<|user|>
Explain quantum computing.<|end|>
<|assistant|>
<|user|>
Write a poem about the first snowfall of the year.<|end|>
<|assistant|>
<|user|>
Write a Python function to implement a neural network from scratch, with detailed comments.<|end|>
<|assistant|>
<|user|>
Write a resume.<|end|>
<|assistant|>
<|user|>
Explain the key concepts of quantum computing and provide a Rust code example demonstrating quantum superposition.<|end|>
<|assistant|>
<|user|>
Explain the concept of dark matter and its significance in the universe.<|end|>
<|assistant|>
<|user|>
Summarize the major events of the French Revolution.<|end|>
<|assistant|>
<|user|>
Describe the water cycle.<|end|>
<|assistant|>
<|user|>
Write a Neurology ICU Admission Note.<|end|>
<|assistant|>
<|user|>
Describe a bustling alien marketplace on a distant planet with unique goods and creatures.Imagine you have a magic potion that grants one wish. What would you wish for and how would it change your life?<|end|>
<|assistant|>
<|user|>
Compose a limerick about a clumsy robot.<|end|>
<|assistant|>
<|user|>
Write a JavaScript function to sort an array of objects by a specific property.<|end|>
<|assistant|>
<|user|>
Design a database schema for a social media platform, considering user profiles, posts, and interactions.<|end|>
<|assistant|>
<|user|>
Implement a basic encryption algorithm in Python.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***

< Generated text for prompt #0 >
Executive Summary:

Our communications business plan outlines our vision for the future of our company and how we plan to achieve our goals. We aim to provide high-quality communication services to our clients, including voice, data, and video services. Our team is dedicated to delivering exceptional customer service and ensuring that our clients' communication needs are met.

To achieve our goals, we will focus on expanding our customer base, improving our technology infrastructure,

< Generated text for prompt #1 >
Quantum computing is a type of computing that uses the principles of quantum mechanics to perform operations on data. Unlike classical computers, which use bits to represent and process information, quantum computers use quantum bits, or qubits. Qubits can exist in multiple states simultaneously, allowing quantum computers to perform many calculations at once. This makes quantum computers potentially much faster and more powerful than classical computers for certain types of problems, such as factoring large numbers or simulating complex quantum systems. However,

< Generated text for prompt #2 >

Gentle whispers of winter's breath,

A dance of white upon the earth.

The first snowfall of the year,

A sight that brings joy and cheer.

It blankets the world in pure white,

A canvas of the winter's night.

The trees stand tall and proud,

Their branches heavy with snowflakes.

Children's laughter fills the air,

< Generated text for prompt #3 >

import numpy as np


class NeuralNetwork:

    def __init__(self, input_size, hidden_size, output_size):

        # Initialize the weights and biases for the input layer, hidden layer, and output layer

        self.input_size = input_size

        self.hidden_size = hidden_size

        self.output_size = output_size

        self.we

< Generated text for prompt #4 >
Sure, I can help you with that! Here's a sample resume for a job in the marketing field:

---

**[Your Name]**

[Your Address]

[City, State, Zip Code]

[Your Phone Number]

[Your Email Address]

[LinkedIn Profile]


**Objective:**

Seeking a dynamic and challenging marketing position that allows me to

< Generated text for prompt #5 >
Quantum computing is a type of computing that uses quantum bits, or qubits, instead of classical bits. Unlike classical bits, which can be in one of two states (0 or 1), qubits can be in a superposition of states, meaning they can be in multiple states at the same time. This allows quantum computers to perform certain calculations much faster than classical computers.

One of the key concepts of quantum computing is entanglement, which is the phenomenon where two

< Generated text for prompt #6 >
Dark matter is a form of matter that is thought to account for approximately 85% of the matter in the universe and about a quarter of its total energy density. Its presence is implied in a variety of astrophysical observations, including gravitational effects that cannot be explained by accepted theories of gravity unless more matter is present than can be seen. For example, the rotation curves of galaxies, which show that the outer regions of galaxies rotate at the same speed as the inner regions, suggest

< Generated text for prompt #7 >
The French Revolution was a period of radical social and political upheaval in France that lasted from 1789 to 1799. It began with the financial crisis caused by the country's involvement in the American Revolution and the extravagant spending of the monarchy. The crisis led to the convening of the Estates-General in 1789, which was the first time in centuries that representatives from the three estates (cler

< Generated text for prompt #8 >
The water cycle, also known as the hydrologic cycle, is the continuous movement of water on, above, and below the surface of the Earth. It involves several key processes: evaporation, transpiration, condensation, precipitation, and runoff. Water evaporates from the surface of the Earth, primarily from oceans, lakes, and rivers, and rises into the atmosphere. This water vapor cools and condenses into clouds through the process of

< Generated text for prompt #9 >
Patient Name: John Doe

Date of Admission: 01/01/2023

ICU Admission Note:

Chief Complaint: Severe headache, confusion, and loss of consciousness

History of Present Illness: The patient, a 45-year-old male, presented to the emergency department with a severe headache, confusion, and loss of consciousness. He reported that the sympt

< Generated text for prompt #10 >
The alien marketplace is bustling with activity, with a variety of unique goods and creatures on display. The market is filled with vibrant colors and strange sounds, as merchants haggle over prices and customers haggle back. There are creatures of all shapes and sizes, from small, furry beings to large, towering creatures with wings. The goods on display are just as diverse, with strange and exotic items that are unlike anything on

< Generated text for prompt #11 >
There once was a robot so clumsy,

Whose circuits would often get jumpy.

It tripped on its own feet,

In a dance of defeat,

And now it's just a pile of junky.<|end|>

< Generated text for prompt #12 >
function sortByProperty(arr, prop) {
    return arr.sort((a, b) => {
        if (a[prop] < b[prop]) {
            return -1;
        }
        if (a[prop] > b[prop]) {
            return 1;
        }
        return 0;
    });
}<|end|>

< Generated text for prompt #13 >
To design a database schema for a social media platform, we need to consider the relationships between different entities such as users, posts, and interactions. Here's a possible schema:


1. **Users Table**:

   - UserID (Primary Key): A unique identifier for each user.

   - Username: The user's display name.

   - Email: The user's email address.

   - Password: The user's

< Generated text for prompt #14 >
Here is a simple example of a basic encryption algorithm in Python using the Caesar cipher technique. The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted a certain number of places down or up the alphabet.


```python

def caesar_cipher_encrypt(plaintext, shift):

    ciphertext = ""

    for char in plaintext:

        if char.is

Prompt: 1626.16 tokens-per-sec (840 tokens / 0.5 sec)
Generate: 409.97 tokens-per-sec (1500 tokens / 3.7 sec)
*** Prompt ***
<|user|>
Write a mystery horror.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***
Once upon a time, in a small town nestled in the heart of the countryside, there was a mysterious house that stood at the edge of town. The house was said to be haunted by the ghost of a young girl who had died in a tragic accident.

The townspeople were fascinated by the house and would often gather at the edge of the property to watch the ghostly apparitions that were said to appear at night. Some 


Prompt: 308.32 tokens-per-sec (13 tokens / 0.0 sec)
Generate: 115.87 tokens-per-sec (100 tokens / 0.9 sec)
*** Prompt ***
<|user|>
<|image_1|>
What is shown in this image?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x6010C45C0>
*** Output ***
The image depicts a historical scene of New York and its environs, featuring a variety of activities and landmarks from a bygone era. There are ships, carriages, and people engaged in various activities, suggesting a bustling port city.<|end|> 


Prompt: 878.64 tokens-per-sec (1939 tokens / 2.2 sec)
Generate: 89.13 tokens-per-sec (55 tokens / 0.6 sec)
*** Prompt ***
<|user|>
Write an executive summary for a communications business plan<|end|>
<|assistant|>
<|user|>
Explain quantum computing.<|end|>
<|assistant|>
<|user|>
Write a poem about the first snowfall of the year.<|end|>
<|assistant|>
<|user|>
Write a Python function to implement a neural network from scratch, with detailed comments.<|end|>
<|assistant|>
<|user|>
Write a resume.<|end|>
<|assistant|>
<|user|>
Explain the key concepts of quantum computing and provide a Rust code example demonstrating quantum superposition.<|end|>
<|assistant|>
<|user|>
Explain the concept of dark matter and its significance in the universe.<|end|>
<|assistant|>
<|user|>
Summarize the major events of the French Revolution.<|end|>
<|assistant|>
<|user|>
Describe the water cycle.<|end|>
<|assistant|>
<|user|>
Write a Neurology ICU Admission Note.<|end|>
<|assistant|>
<|user|>
Describe a bustling alien marketplace on a distant planet with unique goods and creatures.Imagine you have a magic potion that grants one wish. What would you wish for and how would it change your life?<|end|>
<|assistant|>
<|user|>
Compose a limerick about a clumsy robot.<|end|>
<|assistant|>
<|user|>
Write a JavaScript function to sort an array of objects by a specific property.<|end|>
<|assistant|>
<|user|>
Design a database schema for a social media platform, considering user profiles, posts, and interactions.<|end|>
<|assistant|>
<|user|>
Implement a basic encryption algorithm in Python.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***

< Generated text for prompt #0 >
Executive Summary

Our company, XYZ Communications, is a leading provider of communication solutions for businesses of all sizes. We offer a wide range of services, including voice and data services, managed IT services, and cybersecurity solutions. Our mission is to provide our clients with reliable, high-quality communication services that meet their unique needs and help them succeed in their business endeavors.

We have a team of experienced professionals who are dedicated to delivering exception

< Generated text for prompt #1 >
Quantum computing is a type of computing that uses quantum-mechanical phenomena, such as superposition and entanglement, to perform operations on data. Unlike classical computers, which use bits to store and process information, quantum computers use quantum bits, or qubits.

Qubits can exist in multiple states simultaneously, allowing quantum computers to perform many calculations at once. This makes them potentially much faster and more powerful than classical computers for certain types of problems.

Quant

< Generated text for prompt #2 >
Whispers of White


The first snowfall of the year,

A silent dance of white flakes,

A serene and tranquil affair,

As nature's canvas is remade.


Each flake a story untold,

A tale of winter's embrace,

A gentle kiss on the ground,

A fleeting moment's grace.


The world stands still, a h

< Generated text for prompt #3 >
def create_neural_network(input_size, hidden_size, output_size):
    # Initialize the weights and biases
    w1 = np.random.randn(input_size, hidden_size)
    b1 = np.random.randn(hidden_size)
    w2 = np.random.randn(hidden_size, output_size)
    b2 = np.random.randn(output_size

< Generated text for prompt #4 >
Sure, I can help you with that. Please provide some information about your work experience, education, skills, and any other relevant details that you would like to include in your resume.<|end|>

< Generated text for prompt #5 >
Quantum computing is a type of computing that uses quantum-mechanical phenomena, such as superposition and entanglement, to perform operations on data. In classical computing, data is represented as bits, which can be either 0 or 1. In quantum computing, data is represented as quantum bits, or qubits, which can be in a state of 0, 1, or any quantum superposition of these states.


Here is a simple Rust code

< Generated text for prompt #6 >
Dark matter is a form of matter that is thought to account for approximately 85% of the matter in the universe and about a quarter of its total energy density. Its presence is implied by observations of gravitational effects that cannot be explained by the observed amount of visible matter alone. For example, the rotation curves of galaxies, the gravitational lensing of light by galaxy clusters, and the cosmic microwave background radiation. Dark matter does not emit, absorb, or

< Generated text for prompt #7 >
The French Revolution was a period of radical social and political upheaval in France that lasted from 1789 until 1799. It began with the financial crisis caused by the country's involvement in the American Revolution and the extravagant spending of the monarchy. The revolution saw the collapse of the Bourbon monarchy, the rise of radical factions, and the Reign of Terror, which led to the execution of King Louis XVI and

< Generated text for prompt #8 >
The water cycle, also known as the hydrologic cycle, is the continuous movement of water within the Earth and the atmosphere. It involves the evaporation of water from the surface of the Earth, primarily the oceans, lakes, and rivers. This water vapor then rises into the atmosphere, cools, and condenses to form clouds. When the clouds become heavy with water droplets, they release precipitation in the form of rain, snow, sleet, or

< Generated text for prompt #9 >
Neurology ICU Admission Note

Patient Name: John Doe
Date of Birth: 01/01/1970
Date of Admission: 01/01/2022
Date of Note: 01/02/2022

Chief Complaint:
The patient presents to the Neurology ICU with a history of seizures and altered mental status

< Generated text for prompt #10 >
If I had a magic potion that granted one wish, I would wish for the ability to communicate with the various alien species that inhabit the bustling marketplace. This would allow me to learn about their culture, trade, and customs, and potentially even forge new friendships and business opportunities. With this newfound understanding, I could become a respected member of the community, and my life would be enriched by the diversity of experiences and knowledge that the

< Generated text for prompt #11 >
There once was a robot quite clumsy,

Whose movements were quite a messy.

It tripped over wires,

And dropped its piles,

In its quest for order, it was quite a messy.<|end|>

< Generated text for prompt #12 >
function sortByProperty(arr, prop) {
    return arr.sort((a, b) => {
        if (a[prop] < b[prop]) {
            return -1;
        }
        if (a[prop] > b[prop]) {
            return 1;
        }
        return 0;
    });
}

const people = [
    { name: 'John', age: 30 },

< Generated text for prompt #13 >
To design a database schema for a social media platform, we need to consider the relationships between different entities such as users, posts, and interactions. Here is a possible schema:


**Users Table**

- UserID (Primary Key)

- Username

- Email

- Password (Hashed)

- Profile Picture URL

- Bio

- Followers Count

- Following Count


**Posts Table**



< Generated text for prompt #14 >
Certainly! Below is a simple example of a basic encryption algorithm in Python, which uses a simple substitution cipher. This algorithm replaces each letter in the plaintext with a corresponding letter some fixed number of positions down the alphabet. For simplicity, we'll use a shift of 3 positions (A -> D, B -> E, etc.).

```python
def encrypt(plaintext):
    """
    Encrypts the plaintext using a simple substitution cipher

Prompt: 1550.39 tokens-per-sec (840 tokens / 0.5 sec)
Generate: 450.26 tokens-per-sec (1500 tokens / 3.3 sec)
*** Prompt ***
<|user|>
Write a mystery horror.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***
The night was dark and full of terrors. The moon was hidden behind a thick blanket of clouds, casting an eerie glow on the desolate landscape. The only sound was the occasional rustle of leaves and the distant howl of a lone wolf.

As the night wore on, a group of friends set out on a camping trip deep in the woods. They were excited to spend the weekend in the great outdoors, but little did they 


Prompt: 83.86 tokens-per-sec (13 tokens / 0.2 sec)
Generate: 31.10 tokens-per-sec (100 tokens / 3.2 sec)
*** Prompt ***
<|user|>
<|image_1|>
What is shown in this image?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x689D3A000>
*** Output ***
The image depicts a historical scene with various elements such as buildings, people, and boats. There are structures that resemble a fort or castle, a large open space that could be a market or public square, and several boats on the water, suggesting a port or harbor setting.<|end|> 


Prompt: 950.26 tokens-per-sec (1939 tokens / 2.0 sec)
Generate: 11.34 tokens-per-sec (60 tokens / 5.2 sec)
*** Prompt ***
<|user|>
Write an executive summary for a communications business plan<|end|>
<|assistant|>
<|user|>
Explain quantum computing.<|end|>
<|assistant|>
<|user|>
Write a poem about the first snowfall of the year.<|end|>
<|assistant|>
<|user|>
Write a Python function to implement a neural network from scratch, with detailed comments.<|end|>
<|assistant|>
<|user|>
Write a resume.<|end|>
<|assistant|>
<|user|>
Explain the key concepts of quantum computing and provide a Rust code example demonstrating quantum superposition.<|end|>
<|assistant|>
<|user|>
Explain the concept of dark matter and its significance in the universe.<|end|>
<|assistant|>
<|user|>
Summarize the major events of the French Revolution.<|end|>
<|assistant|>
<|user|>
Describe the water cycle.<|end|>
<|assistant|>
<|user|>
Write a Neurology ICU Admission Note.<|end|>
<|assistant|>
<|user|>
Describe a bustling alien marketplace on a distant planet with unique goods and creatures.Imagine you have a magic potion that grants one wish. What would you wish for and how would it change your life?<|end|>
<|assistant|>
<|user|>
Compose a limerick about a clumsy robot.<|end|>
<|assistant|>
<|user|>
Write a JavaScript function to sort an array of objects by a specific property.<|end|>
<|assistant|>
<|user|>
Design a database schema for a social media platform, considering user profiles, posts, and interactions.<|end|>
<|assistant|>
<|user|>
Implement a basic encryption algorithm in Python.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***

< Generated text for prompt #0 >
Executive Summary:

Our company, XYZ Communications, is a leading provider of communication solutions for businesses of all sizes. Our mission is to provide reliable, cost-effective, and innovative communication services to our clients, helping them to stay connected and productive.

Our services include voice and data services, as well as cloud-based solutions such as unified communications and collaboration tools. We have a team of experienced professionals who are dedicated to

< Generated text for prompt #1 >
Quantum computing is a type of computing that uses the principles of quantum mechanics to perform operations on data. Unlike classical computers, which use bits to represent and process information, quantum computers use quantum bits, or qubits. Qubits can exist in multiple states simultaneously, allowing quantum computers to perform many calculations at once. This makes quantum computers potentially much faster and more powerful than classical computers for certain types of problems, such as factoring large numbers or simulating complex quantum systems. However,

< Generated text for prompt #2 >

Gentle whispers of white,

A dance of frost on the ground,

The first snowfall of the year,

A silent, serene sound.


Crystals of purity,

Each flake a story untold,

In the quiet of the night,

The world is hushed and cold.


A blanket of peace,

The earth in slumber lies,


< Generated text for prompt #3 >
```python

import numpy as np


class NeuralNetwork:

    def __init__(self, input_size, hidden_size, output_size):

        # Initialize the weights and biases for the layers

        self.weights_input_to_hidden = np.random.randn(input_size, hidden_size)

        self.weights_hidden_to_output = np.random.randn(

< Generated text for prompt #4 >
Sure, I can help you with that! Here's a sample resume for a job in the marketing field:

**[Your Name]**

**[Your Address]**

**[City, State, Zip Code]**

**[Phone Number]**

**[Email Address]**

**[LinkedIn Profile]**

**Summary**

Highly motivated and detail-oriented marketing professional with

< Generated text for prompt #5 >
Quantum computing is a type of computing that uses the principles of quantum mechanics to perform operations on data. The key concepts of quantum computing include superposition, entanglement, and quantum interference.

Superposition is the ability of a quantum system to exist in multiple states simultaneously. In classical computing, a bit can only be in one of two states (0 or 1), but in quantum computing, a qubit can be in a superposition of both states at the same time

< Generated text for prompt #6 >
Dark matter is a form of matter that is thought to account for approximately 85% of the matter in the universe and about a quarter of its total energy density. Its presence is implied in a variety of astrophysical observations, including gravitational effects that cannot be explained by accepted theories of gravity unless more matter is present than can be seen. For example, the rotation curves of galaxies, which show that the outer regions of galaxies rotate at the same speed as the inner regions, suggest

< Generated text for prompt #7 >
The French Revolution was a period of radical social and political upheaval in France that lasted from 1789 to 1799. It began with the financial crisis caused by the country's involvement in the American Revolution and the extravagant spending of the monarchy. The crisis led to the convening of the Estates-General in 1789, which was the first time in centuries that representatives from the three estates (cler

< Generated text for prompt #8 >
The water cycle, also known as the hydrologic cycle, is the continuous movement of water on, above, and below the surface of the Earth. It involves several key processes: evaporation, transpiration, condensation, precipitation, and runoff. Water evaporates from the surface of the Earth, primarily from oceans, lakes, and rivers, and rises into the atmosphere. This water vapor then cools and condenses into clouds through the process

< Generated text for prompt #9 >
Patient Name: John Doe

Date of Admission: 01/01/2023

ICU Admission Note:

Chief Complaint: Severe headache, confusion, and loss of consciousness

History of Present Illness: The patient presented to the emergency department with a severe headache, confusion, and loss of consciousness. The patient reported that the symptoms began suddenly and progressively worsened over

< Generated text for prompt #10 >
The alien marketplace is bustling with activity, with a variety of unique goods and creatures. The market is filled with brightly colored stalls, each selling different items such as exotic fruits, strange gadgets, and bizarre creatures. The air is filled with the sounds of haggling and the smells of exotic spices.

As I walk through the market, I come across a stall selling a potion that promises

< Generated text for prompt #11 >
There once was a robot so clumsy,

Whose circuits would often get jumpy.

It tripped on its own feet,

And in a tizzy,

It dropped its tools, and that was its pity.<|end|>

< Generated text for prompt #12 >
function sortByProperty(arr, prop) {
    return arr.sort((a, b) => {
        if (a[prop] < b[prop]) {
            return -1;
        }
        if (a[prop] > b[prop]) {
            return 1;
        }
        return 0;
    });
}<|end|>

< Generated text for prompt #13 >
To design a database schema for a social media platform, we need to consider the relationships between different entities such as user profiles, posts, and interactions. Here's a possible schema:


1. **Users Table**:

   - `user_id` (Primary Key): A unique identifier for each user.

   - `username`: The user's display name.

   - `email`: The user's email address.

   - `

< Generated text for prompt #14 >
Here is a simple example of a basic encryption algorithm in Python using the Caesar cipher technique. The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted a certain number of places down or up the alphabet.


```python

def caesar_cipher_encrypt(plaintext, shift):

    ciphertext = ""

    for char in plaintext:

        if char.is

Prompt: 1679.92 tokens-per-sec (840 tokens / 0.5 sec)
Generate: 248.45 tokens-per-sec (1500 tokens / 6.0 sec)
adapters/phi3_v
*** Prompt ***
<|user|>
Write a mystery horror.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***
The night was dark and full of terror as the group of friends made their way through the dense forest. They had been hiking for hours, and the only light came from the flashlights they carried. As they walked, they heard strange noises coming from the trees, and they couldn't shake the feeling that they were being watched.

Suddenly, they came across a small clearing, and in the center was a strange, glowing orb. 


Prompt: 71.92 tokens-per-sec (13 tokens / 0.2 sec)
Generate: 40.89 tokens-per-sec (100 tokens / 2.4 sec)
*** Prompt ***
<|user|>
<|image_1|>
What is shown in this image?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x601E845C0>
*** Output ***
The image depicts a historical scene with various elements such as buildings, people, and boats. There are structures that resemble a fort or castle, a large building that could be a barracks or a similar institution, and several boats on the water, some of which appear to be sailing ships. There are also people engaged in various activities, some on horseback, and others walking or standing.<|end|> 


Prompt: 951.40 tokens-per-sec (1939 tokens / 2.0 sec)
Generate: 35.24 tokens-per-sec (84 tokens / 2.4 sec)
*** Prompt ***
<|user|>
Write an executive summary for a communications business plan<|end|>
<|assistant|>
<|user|>
Explain quantum computing.<|end|>
<|assistant|>
<|user|>
Write a poem about the first snowfall of the year.<|end|>
<|assistant|>
<|user|>
Write a Python function to implement a neural network from scratch, with detailed comments.<|end|>
<|assistant|>
<|user|>
Write a resume.<|end|>
<|assistant|>
<|user|>
Explain the key concepts of quantum computing and provide a Rust code example demonstrating quantum superposition.<|end|>
<|assistant|>
<|user|>
Explain the concept of dark matter and its significance in the universe.<|end|>
<|assistant|>
<|user|>
Summarize the major events of the French Revolution.<|end|>
<|assistant|>
<|user|>
Describe the water cycle.<|end|>
<|assistant|>
<|user|>
Write a Neurology ICU Admission Note.<|end|>
<|assistant|>
<|user|>
Describe a bustling alien marketplace on a distant planet with unique goods and creatures.Imagine you have a magic potion that grants one wish. What would you wish for and how would it change your life?<|end|>
<|assistant|>
<|user|>
Compose a limerick about a clumsy robot.<|end|>
<|assistant|>
<|user|>
Write a JavaScript function to sort an array of objects by a specific property.<|end|>
<|assistant|>
<|user|>
Design a database schema for a social media platform, considering user profiles, posts, and interactions.<|end|>
<|assistant|>
<|user|>
Implement a basic encryption algorithm in Python.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***

< Generated text for prompt #0 >
Executive Summary:

Our communications business plan outlines our vision for the future of our company and how we plan to achieve our goals. We aim to provide high-quality communication services to our clients, including voice, data, and video services. Our team is dedicated to delivering exceptional customer service and ensuring that our clients' communication needs are met.

To achieve our goals, we will focus on expanding our customer base, improving our technology infrastructure,

< Generated text for prompt #1 >
Quantum computing is a type of computing that uses the principles of quantum mechanics to perform operations on data. Unlike classical computers, which use bits to represent and process information, quantum computers use quantum bits, or qubits. Qubits can exist in multiple states simultaneously, allowing quantum computers to perform many calculations at once. This makes quantum computers potentially much faster and more powerful than classical computers for certain types of problems, such as factoring large numbers or simulating complex quantum systems. However,

< Generated text for prompt #2 >

Gentle whispers of winter's breath,

A dance of white upon the earth.

The first snowfall of the year,

A sight that brings joy and cheer.


It blankets the world in pure white,

A canvas of the winter's night.

The trees stand tall and proud,

Their branches heavy with snowflakes.


Children's laughter fills the air,


< Generated text for prompt #3 >
```python

import numpy as np


class NeuralNetwork:

    def __init__(self, input_size, hidden_size, output_size):

        # Initialize the weights and biases for the input layer, hidden layer, and output layer

        self.input_size = input_size

        self.hidden_size = hidden_size

        self.output_size = output_size

        self.we

< Generated text for prompt #4 >
Sure, I can help you with that! Here's a sample resume for a job in the marketing field:

---

**[Your Name]**

[Your Address]

[City, State, Zip Code]

[Your Phone Number]

[Your Email Address]

[LinkedIn Profile]


**Objective:**

Seeking a dynamic and challenging marketing position that allows me to

< Generated text for prompt #5 >
Quantum computing is a type of computing that uses quantum bits, or qubits, instead of classical bits. Unlike classical bits, which can be in one of two states (0 or 1), qubits can be in a superposition of states, meaning they can be in multiple states at the same time. This allows quantum computers to perform certain calculations much faster than classical computers.

One of the key concepts of quantum computing is entanglement, which is the phenomenon where two

< Generated text for prompt #6 >
Dark matter is a form of matter that is thought to account for approximately 85% of the matter in the universe and about a quarter of its total energy density. Its presence is implied in a variety of astrophysical observations, including gravitational effects that cannot be explained by accepted theories of gravity unless more matter is present than can be seen. For example, the rotation curves of galaxies, which show that the outer regions of galaxies rotate at the same speed as the inner regions, suggest

< Generated text for prompt #7 >
The French Revolution was a period of radical social and political upheaval in France that lasted from 1789 to 1799. It began with the financial crisis caused by the country's involvement in the American Revolution and the extravagant spending of the monarchy. The crisis led to the convening of the Estates-General in 1789, which was the first time in centuries that representatives from the three estates (cler

< Generated text for prompt #8 >
The water cycle, also known as the hydrologic cycle, is the continuous movement of water on, above, and below the surface of the Earth. It involves several key processes: evaporation, transpiration, condensation, precipitation, and runoff. Water evaporates from the surface of the Earth, primarily from oceans, lakes, and rivers, and rises into the atmosphere. This water vapor cools and condenses into clouds through the process of

< Generated text for prompt #9 >
Patient Name: John Doe

Date of Admission: 01/01/2023

ICU Admission Note:

Chief Complaint: Severe headache, confusion, and loss of consciousness

History of Present Illness: The patient, a 45-year-old male, presented to the emergency department with a severe headache, confusion, and loss of consciousness. He reported that the sympt

< Generated text for prompt #10 >
The alien marketplace is bustling with activity, with a variety of unique goods and creatures on display. The market is filled with vibrant colors and strange sounds, as merchants haggle over prices and customers haggle back. There are creatures of all shapes and sizes, from small, furry beings to large, towering creatures with wings. The goods on display are just as diverse, with strange and exotic items that are unlike anything on

< Generated text for prompt #11 >
There once was a robot so clumsy,

Whose circuits would often get jumpy.

It tripped on its own feet,

In a dance of defeat,

And now it's just a pile of junky.<|end|>

< Generated text for prompt #12 >
function sortByProperty(arr, prop) {
    return arr.sort((a, b) => {
        if (a[prop] < b[prop]) {
            return -1;
        }
        if (a[prop] > b[prop]) {
            return 1;
        }
        return 0;
    });
}<|end|>

< Generated text for prompt #13 >
To design a database schema for a social media platform, we need to consider the relationships between different entities such as users, posts, and interactions. Here's a possible schema:


1. **Users Table**:

   - UserID (Primary Key): A unique identifier for each user.

   - Username: The user's display name.

   - Email: The user's email address.

   - Password: The user's

< Generated text for prompt #14 >
Here is a simple example of a basic encryption algorithm in Python using the Caesar cipher technique. The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted a certain number of places down or up the alphabet.


```python

def caesar_cipher_encrypt(plaintext, shift):

    ciphertext = ""

    for char in plaintext:

        if char.is

Prompt: 1655.97 tokens-per-sec (840 tokens / 0.5 sec)
Generate: 403.07 tokens-per-sec (1500 tokens / 3.7 sec)

    | Task                  | Vanilla Model | Quantized Model | Quantized Cache | LoRA Adapter |
    |-----------------------|---------------|-----------------|-----------------|--------------|
    | Text Generation       |  41.24 tps     |  115.87 tps      |  31.10 tps       |  40.89 tps    |
    | Image Captioning      |  36.51 tps     |  89.13 tps      |  11.34 tps       |  35.24 tps    |
    | Batched Generation    |  409.97 tps     |  450.26 tps      |  248.45 tps       |  403.07 tps    |
.*** Prompt ***
<|user|>
Plot a Lissajous Curve.<|end|>
<|assistant|>
*** Images ***
None
*** Output ***
A Lissajous Curve is a graph of the parametric equations x = A cos(ωt + φ) and y = B sin(ωt + φ), where A and B are constants, ω is the angular frequency, t is the parameter, and φ is the phase shift.

To plot a Lissajous Curve, you can use a programming language like Python with the matplotlib library. Here's an example code to plot a Lissajous Curve:

```python
import<|end|> 


Prompt: 315.54 tokens-per-sec (17 tokens / 0.1 sec)
Generate: 123.00 tokens-per-sec (113 tokens / 0.9 sec)
*** Execution ***
None
None
None
None
*** Prompt ***
<|user|>
Modify the code to plot 3:4 frequency<|end|>
<|assistant|>
*** Images ***
None
*** Output ***
To modify the code to plot a 3:4 frequency, you can simply change the `x` and `y` values to reflect the desired frequency. Here's an example of how you can do this:
```python
import matplotlib.pyplot as plt

x = [1, 2, 3, 4]
y = [3, 6, 9, 12]

plt.plot(x, y)
plt.show()

In this example, the x values are [1, 2, 3, 4] and the y values are [3, 6, 9, 12]. This will plot a line with a frequency of 3:4. You can adjust the x and y values to plot a different frequency.<|end|>

Prompt: 588.20 tokens-per-sec (19 tokens / 0.0 sec)
Generate: 121.20 tokens-per-sec (182 tokens / 1.5 sec)
*** Execution ***
import matplotlib.pyplot as plt

x = [1, 2, 3, 4]
y = [3, 6, 9, 12]

plt.plot(x, y)
plt.show()
1_0.png

None
Map: 100%|█████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.83 examples/s]
Map: 100%|█████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.52 examples/s]
Map: 100%|█████████████████████████████████████████████████████████████████████████| 2/2 [00:03<00:00, 1.61s/ examples]
Map: 100%|█████████████████████████████████████████████████████████████████████████| 2/2 [00:08<00:00, 4.22s/ examples]
/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/datasets/utils/_dill.py:379: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
obj.co_lnotab, # for < python 3.10 [not counted in args]
Filter: 100%|█████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 623.04 examples/s]
Filter: 100%|████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2391.96 examples/s]
Filter: 100%|████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2677.50 examples/s]
Creating CSV from Arrow format: 100%|████████████████████████████████████████████████████| 1/1 [00:00<00:00, 241.30ba/s]
.*** Prompt ***
<|user|>
<|image_1|>
What is shown in this image?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x72D86E480>
*** Output ***
The image depicts a historical scene of New York and its environs, featuring a variety of activities and landmarks from a bygone era. There are ships, carriages, and people engaged in various activities, suggesting a bustling port city.<|end|>

Prompt: 892.36 tokens-per-sec (1939 tokens / 2.2 sec)
Generate: 87.47 tokens-per-sec (55 tokens / 0.6 sec)
*** Execution ***
None
None
None
None
*** Prompt ***
<|user|>
<|image_1|>
What is the location?<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=1200x839 at 0x5DD8B0AD0>
*** Output ***
The image depicts a scene from Governor's Island, as indicated by the text at the top of the image.<|end|>

Prompt: 756.13 tokens-per-sec (1937 tokens / 2.6 sec)
Generate: 75.68 tokens-per-sec (26 tokens / 0.3 sec)
*** Execution ***
None
None
None
None
.Removed temporary directory: tmp


Ran 5 tests in 510.543s

OK


But if I `pip install -U mlx` and get mlx. 0.21, I get

% python test.py
Fetching 9 files: 100%|████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 18706.01it/s]
Fetching 10 files: 100%|█████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 10019.84it/s]
/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/datasets/utils/_dill.py:379: DeprecationWarning: co_lnotab is deprecated, use co_lines instead.
obj.co_lnotab, # for < python 3.10 [not counted in args]
LoRA training failed: pad(): incompatible function arguments. The following argument types are supported:
1. pad(a: array, pad_width: Union[int, tuple[int], tuple[int, int], list[tuple[int, int]]], mode: Literal['constant', 'edge'] = 'constant', constant_values: Union[scalar, array] = 0, *, stream: Union[None, Stream, Device] = None) -> array

Invoked with types: mlx.core.array, tuple, int
s

Ran 0 tests in 10.348s

OK (skipped=1)


The various requirements seem to be pinned to specific versions.  I haven't tried to free them all to the latest.  

(I'm mainly interested in getting this package to caption and keyword my pictures, which it seems to have the potential to do:

% phi3v
model-00002-of-00002.safetensors: 100%|████████████████████████████████████████████| 2.67G/2.67G [11:03<00:00, 4.01MB/s]
model-00001-of-00002.safetensors: 100%|████████████████████████████████████████████| 4.97G/4.97G [16:54<00:00, 4.89MB/s]
Fetching 9 files: 100%|██████████████████████████████████████████████████████████████████| 9/9 [16:55<00:00, 112.82s/it]
config.json: 100%|█████████████████████████████████████████████████████████████████| 3.78k/3.78k [00:00<00:00, 16.6MB/s]
processor_config.json: 100%|████████████████████████████████████████████████████████████| 119/119 [00:00<00:00, 158kB/s]
preprocessor_config.json: 100%|████████████████████████████████████████████████████████| 442/442 [00:00<00:00, 2.73MB/s]
model.safetensors.index.json: 100%|████████████████████████████████████████████████| 68.9k/68.9k [00:00<00:00, 2.47MB/s]
special_tokens_map.json: 100%|█████████████████████████████████████████████████████████| 670/670 [00:00<00:00, 2.27MB/s]
tokenizer_config.json: 100%|███████████████████████████████████████████████████████| 9.52k/9.52k [00:00<00:00, 34.9MB/s]
generation_config.json: 100%|███████████████████████████████████████████████████████████| 136/136 [00:00<00:00, 786kB/s]
tokenizer.json: 100%|██████████████████████████████████████████████████████████████| 1.85M/1.85M [00:00<00:00, 3.60MB/s]
model-00002-of-00002.safetensors: 100%|████████████████████████████████████████████| 3.35G/3.35G [17:19<00:00, 3.22MB/s]
model-00001-of-00002.safetensors: 100%|████████████████████████████████████████████| 4.94G/4.94G [17:52<00:00, 4.61MB/s]
Fetching 10 files: 100%|███████████████████████████████████████████████████████████████| 10/10 [17:53<00:00, 107.35s/it]
/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/gradio/components/chatbot.py:237: UserWarning: You have not specified a value for the type parameter. Defaulting to the 'tuples' format for chatbot messages, but this is deprecated and will be removed in a future version of Gradio. Please set type='messages' instead, which uses openai-style dictionaries with 'role' and 'content' keys.
warnings.warn(

To create a public link, set share=True in launch().

/opt/homebrew/Caskroom/miniconda/base/envs/phi-3-vision-mlx/lib/python3.12/site-packages/PIL/Image.py:3368: DecompressionBombWarning: Image size (115893366 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
warnings.warn(
*** Prompt ***
<|user|>
<|image_1|>
Provide a factual caption, description and comma-separated keywords or tags for this image so that it can be searched for easily<|end|>
<|assistant|>
*** Images ***
<PIL.JpegImagePlugin.JpegImageFile image mode=RGB size=20194x5739 at 0x60E01B4A0>
*** Output ***
The image shows a maritime scene with a large white ship labeled "TRANSMARCHEHR" docked at a pier. There are several red tugboats in the water, and a smaller black ship labeled "SPLIT THREE" is docked nearby. The sky is overcast, and there are various structures and equipment visible in the background. The water appears calm, and there are no visible people in the scene.<|end|>

Prompt: 764.52 tokens-per-sec (2237 tokens / 2.9 sec)
Generate: 34.20 tokens-per-sec (94 tokens / 2.7 sec)
*** Execution ***
None
None
None
None

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

No branches or pull requests

1 participant