Git Product home page Git Product logo

ai-avatar-starter's People

Contributors

adilanchian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ai-avatar-starter's Issues

`btoa` issue in `bufferToBase64` function

Been following the buildspace AI avatar generator project and loving it so far!

I did come across an issue when creating the React app. In the bufferToBase64 function:

const bufferToBase64 = (buffer) => {
    let arr = new Uint8Array(buffer);
    const base64 = btoa(
        arr.reduce((data, byte) => data + String.fromCharCode(byte), '')
    )
    return `data:image/png;base64,${base64}`;
};

I had an issue with btoa not being defined:

error - ReferenceError: btoa is not defined

I did an npm install --save buffer and added import { btoa } from "buffer"; to pages/api/generate.js which fixed my issue. Not sure if anyone else had the same issue?

Question about replacing unique subject identifier

I was following the guidance here, and the suggestion was to replace the unique subject identifier before sending the prompt to the Hugging Face API.

I was slightly confused about what this was for. For example if we do the following:

'a photo of abraza'.replace(/raza/gi, 'abraza')

that would give:

'a photo of ababraza'

and if 'abraza' wasn't provided in the initial prompt, 'abraza' wouldn't be present in the prompt before POSTing to the API. Is this correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.