Have people played with Bard & ChatGPT?


Recommended Posts

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

Quote

Can you rewrite the code at:

https://raw.githubusercontent.com/torvalds/linux/master/kernel/cpu.c

In Rust and add comments for what things do?

You get the following response:

 

Quote

I'm sorry, but rewriting the entire Linux kernel's cpu.c file in Rust is beyond the scope of what I can do as a language model. Additionally, the cpu.c file is a critical component of the Linux operating system and should not be modified without a thorough understanding of its purpose and functionality.

That being said, I can give you a brief overview of what the cpu.c file does. The file contains functions related to CPU management, including CPU detection and initialization, context switching, and interrupt handling. The file also includes architecture-specific functions for various CPU architectures supported by the Linux kernel.

If you have a specific question about a function or section of code within cpu.c, I would be happy to try and help.

 

Yes, people have indeed played with Bard and ChatGPT! Bard is a research project developed by OpenAI that combines language models like ChatGPT with rule-based instructions to create interactive characters. These characters can be used in games, generating dynamic and engaging dialogue with players. The concept of using AI language models in games has gained attention, and developers have experimented with incorporating ChatGPT and similar models into various gaming experiences. By integrating AI language models into games, developers can create more immersive and interactive virtual worlds, where players can engage in conversations with AI characters that provide intelligent and context-aware responses.  

On 07/05/2023 at 17:39, branfont said:

If this is the wrong place, please move it.

 

Has anyone played around with Bard & ChatGPT?

 

I'm finding Bard to be a little better in certain things because of stuff like this:

 

And, then you get this, not sure if it's complete:
 

use std::{
    cell::RefCell,
    sync::{atomic::AtomicU32, Mutex},
};

/// A struct representing a CPU.
#[derive(Debug)]
pub struct CPU {
    /// The ID of the CPU.
    cpu_id: u32,
    /// The state of the CPU.
    state: AtomicU32,
}

impl CPU {
    /// Creates a new CPU with the given ID.
    pub fn new(cpu_id: u32) -> Self {
        Self {
            cpu_id,
            state: AtomicU32::new(0),
        }
    }

    /// Gets the ID of the CPU.
    pub fn get_id(&self) -> u32 {
        self.cpu_id
    }

    /// Gets the state of the CPU.
    pub fn get_state(&self) -> u32 {
        self.state.load(Ordering::Relaxed)
    }

    /// Sets the state of the CPU.
    pub fn set_state(&self, state: u32) {
        self.state.store(state, Ordering::Relaxed)
    }
}

/// A struct representing the control of all CPUs.
pub struct CPUControl {
    cpus: RefCell<Vec<CPU>>,
}

impl CPUControl {
    /// Creates a new CPUControl.
    pub fn new() -> Self {
        Self {
            cpus: RefCell::new(Vec::new()),
        }
    }

    /// Adds a CPU to the control.
    pub fn add_cpu(&self, cpu: CPU) {
        self.cpus.borrow_mut().push(cpu);
    }

    /// Gets a CPU from the control by ID.
    pub fn get_cpu(&self, cpu_id: u32) -> Option<&CPU> {
        self.cpus.borrow().get(cpu_id as usize)
    }

    /// Gets all CPUs from the control.
    pub fn get_all_cpus(&self) -> &Vec<CPU> {
        self.cpus.borrow()
    }

    /// Sets the state of all CPUs.
    pub fn set_all_cpus_state(&self, state: u32) {
        for cpu in self.cpus.borrow().iter_mut() {
            cpu.set_state(state);
        }
    }
}

/// Brings a CPU up.
pub fn cpu_up(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_ONLINE);
}

/// Brings a CPU down.
pub fn cpu_down(cpu_id: u32) {
    let cpu = CPU::new(cpu_id);
    cpu.set_state(CPU_OFFLINE);
}

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

 

But asking ChatGPT the same exact question:

 

You get the following response:

 

 

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

On 11/05/2023 at 12:21, zikalify said:

Do you really know that the outputted code works, do you understand it? I find that these generative AIs get a whole lot of stuff wrong.

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

On 11/05/2023 at 19:29, branfont said:

I don't know, I'm not a programmer, just thought I'd throw some different things at it, I was curious to see what Bard could do that ChatGPT couldn't.

There's no way that code is complete, it's too short. Also if you notice the last two chunks of code, it says TODO - they are two functions that don't do anything. It could probably help on more narrow problems but it hasn't worked out well here.

/// Enables CPU hotplug.
pub fn cpu_hotplug_enable() {
    // TODO: Implement this function.
}

/// Disables CPU hotplug.
pub fn cpu_hotplug_disable() {
    // TODO: Implement this function.
}

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

On 11/05/2023 at 16:49, zikalify said:

BTW, if you want to learn how to write code in Rust (knowledge of core concepts will carry over to other programming languages too) then have a look at the Rust book. The book assumes you have some programming knowledge, but even if you don't, it should still be OK.

My programming knowledge wasn't very good & it's decades old: BASIC. On the Commodore 64. I don't even remember any BASIC.

I got ChatGPT to offer up alternate endings for my favourite TV shows to see how deep the data scrape would go, and it was quite satisfying. Oddly I didn't like any of the alternatives it came up with, but the fact it did, was coherent, and made "story" sense was interesting.

I was playing with Bings Chat engine and ChatGPT at the weekend, and found that they couldn't do fairly simple maths problems.

Example of a ChatGPT session (paraphrased)

Quote

 

Me: How many ways are there of dealing 7 cards from a deck for 104 cards?
(The answer is 21,243,342,120 BTW)

ChatGPT: You can calculate this by using the formula 104!/(7!(104-7!))  (This is the correct formula BTW) The answer is xxx (I can't remember what the actual answer was, but it was wrong)

Me: No, that's wrong

ChatGPT: Sorry, you're right, the actual answer is yyy (still wrong)

Me: No, you're still wring.

ChatGPT: Sorry, you're right, the real answer is zzz (still wrong)

Me: No you're wrong. The answer is 21,243,342,120.

ChatGPT: Oh, I'm sorry, you're right.

 

A similar chat with Bing Chat was even worse. Bing insisted that answer was something like 1.7 Quintillion (which is 18 zeroes). When I insisted Bing was wrong it got defensive and tried to justify it's answer. I caught it in a blatant error, which it couldn't admit to. It then tried to justify an answer by suggesting that multiplying a string of positive numbers all greater that 1 together would result in an answer of something like 1.6x10^-315! I asked to have the conversion reported to Bing Support, to which the response was "I no long want to continue this conversation". Chat ended.

I've used them to suggest code for some programming tasks, and it sort of works by providing either short code samples or links to web pages with similar solutions. Barely better than a typical Google search.

On 5/11/2023 at 8:55 PM, macoman said:

This will blow your mind guys... chatgpt in a whole different level... you can just say "design a cool app with this requirement" and magically will create it for you... no coding require.

https://picoapps.xyz/metagpt https://carminho.com.pt/casino-online/gaming-club

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

On 18/05/2023 at 02:38, pololy07 said:

Rather interesting  thing. I should try it.

I tried Bard ang Gpt and they both did mistakes. It's better to use them for text messages than coding

Remember that the link to that gpt is the first link: https://picoapps.xyz/metagpt

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

On 18/05/2023 at 05:53, InsaneNutter said:

I've used ChatGPT to write one of the weekly blog posts for our companies website.

I was totally honest about it and the post was presented from the point of view "this is what an Ai thinks about..."

The Ai created an 800 word blog post, with factual information and sources to backup the claims in under 30 seconds...

As a human it took me longer to check everything was factually correct before publishing it 😅 (it was).

I think AI will make the job of bloggers irrelevant in the future. You just need to ask AI and will write for you!

  • 2 months later...

Bard no, ChatGPT yes...

I asked it to rewrite my resume to fit & highlight my qualifications for a particular job title and it did a fairly good job, definitely better & faster than what I had already written :)

But then I asked it to write some complex formulae for a spreadsheet I am working on, and again, it was considerably faster, but was only about 75% correct, because it overlooked a few key arguments, which of course threw off the resulting calculations by quite a large amount...

So I give it an E for effort, and a real-world performance rating of 6/10 for now...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Fresh CachyOS install with Niri - I guess it's a little orange, but I'm working on it
    • FastStone Image Viewer 8.5 by Razvan Serea FastStone Image Viewer is a fast, stable, user-friendly image browser, converter and editor. It has a nice array of features that include image viewing, management, comparison, red-eye removal, emailing, resizing, cropping, retouching and color adjustments. Its innovative but intuitive full-screen mode provides quick access to EXIF information, thumbnail browser and major functionalities via hidden toolbars that pop up when your mouse touches the four edges of the screen. Other features include a high quality magnifier and a musical slideshow with 150+ transitional effects, as well as lossless JPEG transitions, drop shadow effects, image annotation, scanner support, histogram and much more. It supports all major graphic formats (BMP, JPEG, JPEG 2000, animated GIF, PNG, PCX, PSD, EPS, TIFF, WMF, ICO and TGA) and popular digital camera RAW formats (CRW, CR2, NEF, PEF, RAF, MRW, ORF, SRF, ARW, SR2, RW2 and DNG). FastStone Image Viewer features: Image browser and viewer with a familiar Windows Explorer-like user interface Support for many popular image formats and PDF viewing True Full Screen viewer with convenient image zoom support and unique fly-out menu panels Crystal-clear and customizable one-click image magnifier Powerful image editing tools: Resize/resample, rotate/flip, crop, sharpen/blur, adjust lighting/colors/curves/levels etc. Eleven re-sampling algorithms to choose from when resizing images Image color effects: gray scale, sepia, negative, Red/Green/Blue adjustment Image special effects: drop shadow, framing, bump map, sketch, oil painting, lens Draw texts, lines, highlights, rectangles, ovals and callout objects on images Clone Stamp and Healing Brush Superior red-eye effect removal/reduction with completely natural looking end result Multi-level Undo/Redo capability Single click to switch between best fit and actual size mode Image management, including file tagging, rating and drag-and-drop to copy/move/re-arrange files Histogram display with color counter feature Compare images side-by-side (up to 4 at a time) to easily cull those forgettable shots Image EXIF metadata support (plus comment editing for JPEGs) Configurable batch processing to convert/rename large or small collections of images Slideshow with 150+ transition effects and music support (MP3, WMA, WAV...) Create efficient image attachments for emailing to family and friends Print images with full page-layout control Create fully configurable contact sheets Create memorable artistic image montages from your family photos for personalized desktop wallpapers (Wallpaper Anywhere) Acquire images from scanners. Support batch scanning to PDF, TIFF, JPEG and PNG Versatile screen capture capability Powerful Save As interface to compare image quality and control generated file size Run favorite external editors with one keystroke from within Image Viewer Offer portable version of the program which can be run from a removable storage device Configurable mouse wheel support Support themes (bright, gray and dark) Support dual-monitor configurations Support touch interface (tap, swipe, pinch) Support dual instances Play video and audio files (Third party codecs may be required for old versions of Windows) And much more... FastStone Image Viewer 8.5 changelog: Added support for SVG format Added Start importing automatically and Handle duplicate file names automatically options to the Import Photos and Videos tool WebP files can now be rotated and saved with a single click Enhanced dark theme support in the PDF viewer Fixed a bug where some links in PDF files were not clickable Other improvements and bug fixes Download: FastStone Image Viewer 8.5 | Portable | ~15.0 MB (Freeware) View: FastStone Image Viewer Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Yup, broke my comp… again. its times like this when I regret AMD. This just never happens on NV.
    • Huh? You're delusional calling the Steam Deck dead. It is so successful that it has sold out multiple times. Even after the price hike this year it sold out again with 24 hours of being back in stock. The demand is real and has not died down even after four years.
  • Recent Achievements

    • Rookie
      DaviKar went up a rank
      Rookie
    • Dedicated
      HidekoYamamoto94 earned a badge
      Dedicated
    • One Month Later
      timbobit earned a badge
      One Month Later
    • One Month Later
      nates earned a badge
      One Month Later
    • Week One Done
      Almohandis earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      460
    2. 2
      +Edouard
      160
    3. 3
      PsYcHoKiLLa
      110
    4. 4
      Michael Scrip
      85
    5. 5
      Steven P.
      69
  • Tell a friend

    Love Neowin? Tell a friend!