teleren/devto huggingface dataset:
🤖Ask-me a service designed to assist with various tasks٫‌🖼NFT creation, 📝generating quotes, 🎼audio transcription and ...
Tags: cloudflarechallenge, devchallenge, ai, web
Published: 2024-04-14 21:54:22

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

![GIF Demo](https://cdn.discordapp.com/attachments/1113510096622862375/1229167743748538480/Q2-ezgif.com-video-to-gif-converter.gif?ex=662eb2aa&is=661c3daa&hm=d288c303d8a712148b6221c36d018adba39d8fb42bfef29ae3f07cccd88afe4b&)

`UI may appear broken, but I couldn't have done better.`

## Technologies used in project:
 - FastAPi
 - React
 - Tailwind


⚠️**Initially** my idea was to create a simple image generator inspired by the impressive visuals of some NFTs. I wanted to throw myself deep down into the possibility of using a model to generate NFTs based on user input.

✨**Additionally**, I included a feature to help users improve their commands by upgrading and adding extra details into given command.
Also another feature allows users to request a quote along with an image of its author, adding a touch of authenticity.

🎈**Moreover**, Ask-me supports content in multiple languages by automatically translating it into English. Users can also upload audio files to receive a transcript containing all the words spoken, along with a word count.

## Demo

[🔥Live Demo💻](https://ask-me-front-cloudflare.pages.dev/)

## My Code

{% embed https://github.com/itz-Amethyst/ask-me %}

## Journey

Given that this was my first touch with workers and AI models, the circumstances were undeniably challenging. In particular, the pressure to complete the task within just 1/5 day it did cost sacrificing sleep

## If I had more time, there are a few things I'd like to add or improve:

1. Enhance the user experience on the frontend, especially in terms of design. Making it more visually appealing can make a big difference.
1. Implement a voice recording feature for whispers. It could add a personal touch and make interactions more engaging.
1. Enable a feature to save pictures to the D1 database, associating them with user IP and browser information as identifiers.
1. Find a solution to deploy Python workers along with their requirements on Cloudflare. This could streamline the deployment process and make scaling easier.

**Multiple Models and/or Triple Task Types**

```python
NFT_Model = "stable-diffusion-xl-lightning"
Chat_Model = "llama-2-7b-chat-fp16"
Improve_NFT_Command_Model = "hermes-2-pro-mistral-7b"
Quote_Model = "mistral-7b-instruct-v0.2"
Translate_Model = "m2m100-1.2b"
Audio_Model = "whisper"
```
<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->

<!-- Don't forget to add a cover image or an additional tag to this post (if you want). -->

<!-- Thanks for participating! -->
The difference between OS Disk, Data Disk and Temporary Disk.
Published: 2024-04-14 21:36:06

**WHAT IS A DISK IN AZURE?**
In azure, a disk is a place to store an operating system, applications and data.

There are three main disk in Azure: 
1) Operating System disk
2) Data disk
3) Temporary disk.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62wa46ec712hxdf844au.png)


**Operating System disk**
a) The OS disk is the disk that houses the operating system.
b) That OS disk has a pre-installed OS, which was selected when the 
  VM was created. 
c) This disk contains the boot volume (This is where OS stores it 
   system files)
d) Os disk is persistent.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7va91k5jp6y8dxolepj.png)



**Data disk**
a) A data disk is a managed disk that's attached to a virtual 
   machine to store application data, or other data you need to 
   keep. 
b) Data disks are registered as SCSI (Small Computer System 
   Interface) drives and are labeled with a letter that you choose. 
c) The size of the virtual machine determines how many data disks 
   you can attach to it.
d) Data disk is persistent.
e) Generally, you should use the data disk to store your 
   applications and data, instead of storing them on OS disks.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yqacirkncmhyxvx5gypg.png)


**Temporary disk**
a) The temporary disk provides short-term storage for applications 
   and processes, and is intended to only store data such as page 
   files, swap files etc.
b) Most VMs contain a temporary disk, which is not a managed disk.  c) Data on the temporary disk may be lost during a maintenance, 
   when you redeploy a VM, or when you stop the VM. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lx8nmxbxvea7fet7f04.png)
How to Create and attach a data disk to the VM.
Published: 2024-04-14 21:26:47

**How to create data disk in azure**

- Sign in to the Azure portal.
- Search for and select Virtual machines. 
- On the Virtual machine pane under setting, select Disks.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltpwzvl6nvbq4dl7fmut.png)


- On the Disks page, select Create and attach a new disk.
- In the drop-downs lists for the new disk, make the selections you want, and name the disk.
- click apply to create the disk. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q7s5f8ujrf32h1oujba.png)



**Initialize a new data disk**

- Connect to the VM (RDP into your vm)
- Right click the Windows Start menu inside the running VM and click disk management. The Disk Management console opens.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y51nt7z7tf66ces1hyhh.png)



- Disk Management recognizes that you have a new, uninitialized disk and the Initialize Disk window appears.
- Select OK to initialize it.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtkjw19xmdu2ndiraqdk.png)


- The new disk appears as unallocated. Right-click anywhere on the disk and select New simple volume. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tawr3uyzyiko9bap2439.png)


- The New Simple Volume Wizard window opens,Proceed through the wizard, keeping all of the defaults, and when you're done select Finish.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo2o1b4i3cyv7c408k7q.png)


- Close Disk Management.

- A pop-up window appears notifying you that you need to format the new disk before you can use it. Select Format disk.

- When the formatting is complete, select OK.

**View your new Data Disk**
Inside the running VM, click file explorer.
click this PC

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh3yng0ighx118lokicd.png)

 in this PC page you will see your new disk with the name new volume(f).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55ylkfy682u7yqjcv1lm.png)

**Renaming the data disk**
You can decide to personalize it be renaming the disk.

- Right click on the disk, click show more options.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wb9dydi66nwhbgmxcu3.png)

- Click rename.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80jc8rjodv5c53mpmr57.png)

- Type in the new name and strike enter on your keyboard

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9s6pod4zxaku20c0yev.png)

there you have the new name!!!

we can decide to save a file into our new data disk 
let's try it out

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvor9r8yuyqvtvm6tpk6.png)

Wao, here we have them.



PEREFECT!!!
WE HAVE OUR NEW DATA DISK CREATED, ATTACHED AND INITIALIZED.

....I hope this was helpful.
AI Twitter & LinkedIn Bio Generator
Tags: cloudflarechallenge, devchallenge, ai, nextjs
Published: 2024-04-14 20:48:50

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

Excited to share my project, a NextJS full-stack web application designed to craft personalized Twitter or LinkedIn bios! Just enter a brief description of your profession or passions, choose your desired tone—be it Professional, Casual or Relaxed, or Funny—and hit 'generate'. It'll generate three different bios tailored to the selected vibe, ready for you to pick and copy with a simple click.

## Demo
Link: [https://ai-bio-gen.pages.dev](https://ai-bio-gen.pages.dev/)

![AI Bio Generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qdohersem88wk8s2jzdj.jpg)

![Casual Twitter Bio Generated](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zy6roio9fkserejmg821.png)

![Funny Twitter Bio Generated](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jipshlxcq0t74j3s54qb.png)

![Casual LinkedIn Bio Generated](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfm9rkqavvr5g8nvticb.png)

## My Code

Here is the link to my Repo: https://github.com/theanilsomani/ai-bio-generator


## Journey

This is my very first full-stack endeavor! It all started with an existing GitHub project that could only do Twitter bios, with a choice between two AI models. If you're curious, here's the original: [Original Twitter Bio Generator](https://github.com/Nutlope/twitterbio).

I then switched gears to Cloudflare's Worker AI API, the Mistral 7b model, to power up the bio-gen magic. Not only did I manage to add LinkedIn bios to the mix, but I've also got big plans for more models and text-gen features down the road.

I stumbled upon the Cloudflare competition a little late, so for now, I'm rolling with one model. But hey, it's been a blast learning about API routes and how to get things up and running on Cloudflare Pages.
Designing and Implementing a Microsoft Azure AI Solution
Tags: python, ai, azure, algorithms
Published: 2024-04-14 20:43:31


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06jl8fmwmg91z09krel6.jpeg)from azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential

# Set up the client with your Azure key and endpoint
key = "your-key-here"
endpoint = "your-endpoint-here"

text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))

# Example function to analyze sentiment
def analyze_sentiment(
    print("Document Sentiment: response.confidence_scores.neutral,
        response.confidence_scores.negative,
    ))

# Example usage
text_to_analyze = "Azure AI is quite impressive!"
analyze_sentiment(text_to_analyze)
AI comment moderator
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-14 20:41:37

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

I built a comment system moderated by AI, eliminating the need for a human intervention and saving countless hours on reading useless comments full of spam or profanity.

## Demo

https://cf-challenge-comment-system.pages.dev/

## My Code

https://github.com/Xubaer/cf-challenge-comment-system

## Journey

I never knew how powerful cloudflare really can be and it has pages and workers functionality.
I used cloudflare Ai to moderate comments from users using two different models, one to moderate the comments and the other for sentiment analysis which helps showing the up/down vote counts :D 
I hope to make this as a white label project which can be integrated and injected into different websites and apps. It would work as plug and play.

**Multiple Models and/or Triple Task Types**
 Used `"@hf/thebloke/openhermes-2.5-mistral-7b-awq"` to moderate comments and receive a json format about the comment.
`"@cf/huggingface/distilbert-sst-2-int8"` for sentiment analysis that helps me add count to the up/down votes for the overall comments.
Generative AI & Gemini
Tags: ai, google, googlecloud
Published: 2024-04-14 20:15:18

## What is Generative AI?
Generative AI has become very popular lately where its being used by the masses to generate different types of content ranging from text, images, videos, etc. Generative AI is a subset of artificial intelligence (AI) techniques that focus on generating new, original content based on input data or patterns learned from existing data. Unlike traditional AI models that are designed for specific tasks such as classification or prediction, generative AI models are capable of creating entirely new data samples that resemble the training data they were exposed to. It makes the uses of generative models which generate new content based on a learned probability distribution of existing data.

## What is Gemini?
Gemini is a LLM (large language model) developed by Google Deepmind capable of generating text, translating language and writing all sorts of creative content. It is **multimodal** in the sense that it can understand a wide range of information ranging from text,audio, images, etc and provide output accordingly.

Visit [here](https://gemini.google.com/app) to try out it's capabilities.

I know this article is short. In the next we will be building a generative AI application with the [Gemini API](https://github.com/google-gemini/cookbook)
How I implement dev.to API on my website 🤗
Tags: javascript, programming, learning, api
Published: 2024-04-14 20:08:56

I have created my own portfolio and described what it has in [a previous article](https://dev.to/locnguyenpv/what-i-have-in-my-portfolio-44bd). In this article, I will show how I use [DEV Community API](https://developers.forem.com/api/v1) to fetch articles that I have published. 

## Get API 🔑
Like every API, you need to get your API key first.

1. Go to your [settings/extensions pages](https://dev.to/settings/extensions)

2. Find the section name **"DEV Community API Keys"** at the end and fill the description with every text you want (ex: Expose Article), click button to generate API key
![API Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh3aoj9xvgeyxmdxgcge.png)

3. It will generate the collapsed item below, exposing it to get the key
![Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5pbqbexuty75jpisd7l.png)

## Get published articles
After you got API key, you can use the code below to get the data
```js
/**
 * Get published articles.
 * @param {number} page_size - the number of items to return per page.
 */
function fetch_articles(page_size = 7){
  // Build URL
  const base_url = "https://dev.to"; // domain
  const router = "api/articles/me"; // API router
  const url = `${base_url}/${router}?per_page=${page_size}`; // https://dev.to/api/articles/me/published?per_page=7

  // Get data from API
  const response = await fetch(url, {
    headers: {
      "Content-Type": "application/json",
      "API-Key": "Your Key Is Here",
    },
  }).then((data) => data.json());

  return response;
}
```

## Conclusion
So that is the way I use [DEV Community API] (https://developers.forem.com/api/v1) to get published articles. In the next article, I will write about why and how I combine Google Sheets + Google Drive to save my pet projects 😬

Happy Coding!
Follow Below Links, Get Information For Wishes & Lotteries
Published: 2024-04-14 19:28:40

https://lotterywinningnumbersusa.com/
https://www.lotteryusa7.com/
https://ez2resultstoday.com/
https://www.happybirthdaywishfor.com/
https://www.100birthdaywishes.com/
https://www.100happybirthdaywishes.com/
AI Chief
Tags: cloudflarechallenge, devchallenge, ai, flask
Published: 2024-04-14 19:06:01

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

I built an AI-powered cooking assistant called Ai-Chief. Ai-Chief helps users discover recipes, provides ingredient lists, and calculates the approximate calorie content of dishes. Users can simply upload the image of a dish, and Ai-Chief will generate step-by-step instructions on how to prepare it, list all the required ingredients, and provide calories informations.

## Demo

[View on Demo](https://mlaithy.pythonanywhere.com/)

## My Code
[View on GitHub](https://github.com/Mohamed-Hamdy/Ai-Chief/tree/master)

## Journey
In developing Ai-Chief, I utilized Cloudflare APIs to interact with AI models for recipe retrieval and calorie calculation. I also used Flask to build this project. I'm particularly proud of how seamlessly Ai-Chief provides cooking assistance to users based on their input

**Multiple Models and/or Triple Task Types**

<table border="1">
  <tr>
    <th>Type</th>
    <th>Model Name</th>
  </tr>
  <tr>
    <td>Image-to-Text</td>
    <td><a href="https://developers.cloudflare.com/workers-ai/models/uform-gen2-qwen-500m/">uform-gen2-qwen-500m</a></td>
  </tr>
  <tr>
    <td>Summarization</td>
    <td><a href="https://developers.cloudflare.com/workers-ai/models/bart-large-cnn/">bart-large-cnn</a></td>
  </tr>
  <tr>
    <td>Text Generation</td>
    <td><a href="https://developers.cloudflare.com/workers-ai/models/openchat-3.5-0106/">openchat-3.5-0106</a></td>
  </tr>
  <tr>
    <td>Translation</td>
    <td><a href="https://developers.cloudflare.com/workers-ai/models/m2m100-1.2b/">m2m100-1.2b</a></td>
  </tr>
</table>
Next js Configuring
Tags: webdev, javascript, nextjs, react
Published: 2024-04-14 19:00:00

### Introduction

Next.js offers a robust configuration system that allows developers to customize various aspects of their applications according to specific requirements. This article aims to provide a comprehensive guide to configuring Next.js projects, covering basic configuration options and best practices.

### 1. Basic configuration

Next.js projects usually start with minimal configuration, but as your project grows, you may need to adjust the settings. The `next.config.js` file serves as the entry point for configuring your Next.js application.

```javascript
// next.config.js
module.exports = {
  /* Your configuration options */
};
```

### 2. Webpack Customization

Next.js uses Webpack under the hood to pool resources and optimize the build process. You can extend or override the Webpack configuration options in `next.config.js` to meet specific requirements.

```javascript
// next.config.js
module.exports = {
  webpack: (config, { dev, isServer }) => {
    // Edit Webpack configuration here
    return configuration;
  },
};
```

### 3. Environment variables

Next.js provides built-in support for environment variables, allowing you to define variables that vary depending on the environment (development, production, etc.).

```javascript
// next.config.js
module.exports = {
  env: {
    API_URL: process.env.API_URL,
  },
};
```

```javascript
// Use in components/pages
function HomePage() {
  return (
    <div>
      <h1>Welcome to Next.js</h1>
      <p>API URL: {process.env.API_URL}</p>
    </div>
  );
}

export default homepage;
```

### 4. Customize the Babel configuration

Babel is used in Next.js to port modern JavaScript features for cross-browser compatibility. You can edit the Babel configuration in `next.config.js` to add plugins or preferences.

```javascript
// next.config.js
module.exports = {
  babel: {
    preferences: ['next/babel'],
    plugins: [['styled-components', { ssr: true }]],
  },
};
```

### 5. Optimization of report output

Next.js allows you to optimize the output of the build process by specifying options such as asset prefix, target, and optimization settings.

```javascript
// next.config.js
module.exports = {
  basePath: '/app',
  assetPrefix: '/static',
  target: 'serverless',
  experimental: {
    optimalCss: true,
  },
};
```

### 6. ESLint configuration extension

You can extend the ESLint configuration for your Next.js project to enforce coding standards and maintain code quality.

```javascript
// next.config.js
module.exports = {
  eslint: {
    dirs: ['src', 'pages'],
  },
};
```

### Conclusion

Next.js project configuration is essential to optimize development workflow, increase performance, and ensure scalability. By taking advantage of the extensive configuration options that Next.js provides, developers can customize their projects to meet specific requirements and achieve desired results.
Laravel - Unlock the Power of Laravel Gates for Simplified Authorization
Tags: php, laravel, webdev, productivity
Published: 2024-04-14 18:45:32

Hello everyone,

Are you searching for a robust solution to regulate access within your Laravel application? Look no further than Laravel Gates – your key to seamless authorization management. Gates offers a concise and expressive means to define access rules for various actions and resources within your application.

**⚙️ Understanding Gates**:

Gates serve as PHP callables that assess defined authorization logic, returning either true or false. Leveraging Gates, you can safeguard routes, controller actions, or any other critical component of your application.



**🔑 Illustrative Example: Safeguarding User Features Access**

Let's consider a scenario where access to certain features is restricted to authenticated users. Here's how you can implement and utilize a Gate for this purpose:

```
<?php

use Illuminate\Support\Facades\Gate;

// Define a gate to grant access to certain features for regular users

Gate::define('access-user-features', function ($user) {
    return $user->hasRole('user');
});

```

Subsequently, protect your route as follows:

```
<?php

// Protect the route to user features using the gate
Route::get('/user/features', function () {
    // Only allow access to users
})->middleware('can:access-user-features');
```

**🛡️ Harnessing Gates in Controllers:**

Furthermore, Gates seamlessly integrates within controller methods, facilitating precise control over access to specific actions. For example, to exclusively permit authenticated users to update their profiles:

```
<?php

// Example usage of the gate in a controller method to update user profile
namespace App\Http\Controllers;

use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;

class UserController extends Controller
{
    public function update(Request $request, User $user)
    {
        // Check if the user is authorized to update their own profile
        if (Gate::denies('access-user-features')) {
            abort(403, 'Unauthorized action.');
        }

        // Logic for updating user profile
    }
}

```

With Laravel Gates, enforcing access control within your application becomes effortlessly manageable, ensuring heightened security and tranquility for both you and your users. 🔒✨

Thank you and happy coding! 🖤