GithubHelp home page GithubHelp logo

Comments (8)

Wauplin avatar Wauplin commented on August 28, 2024 2

Oh right, thanks for noticing! This list is out of date then. I created an issue on huggingface_hub (huggingface/huggingface_hub#1424)

⚠️ You copy-pasted your token in the snippet above. I advice you to revoke it right now on https://huggingface.co/settings/tokens. For next tests you can use huggingface-cli login to login your machine so that you don't need to paste it in plain in your scripts.

from jarvis.

Wauplin avatar Wauplin commented on August 28, 2024 2

@tricktreat You really need to revoke it, i.e. create a new one. You can do that in your settings by clicking on Manage > Invalidate and refresh. You'll need to update it in the applications you have but it'll be safer this way.

2023-04-05_19-04

On Github even when you edit a comment the previous version of the text can be accessed (if you see the little arrow on the right of edited in your comment). So your token is still visible to everyone at the moment 😕

from jarvis.

tricktreat avatar tricktreat commented on August 28, 2024 2

@Wauplin Thanks again! I was negligent about this. I have now completed the token reset according to your instructions.

from jarvis.

tricktreat avatar tricktreat commented on August 28, 2024 1

@Wauplin Thanks for your practical suggestion, we'll incorporate it into the plan!

from jarvis.

tricktreat avatar tricktreat commented on August 28, 2024

Just to be sure, not all tasks huggingface_hub are supported? @Wauplin

from jarvis.

Wauplin avatar Wauplin commented on August 28, 2024

@tricktreat all tasks that the Inference API on the Hub support are supported by this client (it's "just" a wrapper around requests). However only a few tasks will have its output parsed correctly. Otherwise you can get the raw response from the server (see reference).

If you see have feedback on the InferenceAPI client itself, please let me know. I'd glad to improve it if needed :)

from jarvis.

tricktreat avatar tricktreat commented on August 28, 2024

@Wauplin Thanks. I simply tried the image-to-image task and got {'error': 'Task image-to-image is invalid'}. I think maybe not all tasks are supported.

import io
from diffusers.utils import load_image
from huggingface_hub.inference_api import InferenceApi

def image_to_bytes(img_url):
    img_byte = io.BytesIO()
    load_image(img_url).save(img_byte, format="jpeg")
    img_data = img_byte.getvalue()
    return img_data

inference = InferenceApi("lambdalabs/sd-image-variations-diffusers", token="****")
result = inference(data=image_to_bytes("https://raw.githubusercontent.com/justinpinkney/stable-diffusion/main/assets/im-vars-thin.jpg"))
print(result)

I also checked the code and here seems to be the currently supported tasks.

from jarvis.

tricktreat avatar tricktreat commented on August 28, 2024

Thanks for the reminder. I've edited it.

from jarvis.

Related Issues (20)

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.