Running
1
🌘W🌖
LowRes animated waifus (✿◡‿◡)
POST /api/games
- Create a new gameGET /api/games/:gameId
- Get the current game statePOST /api/games/:gameId/move
- Make a move (up, down, left, right)DELETE /api/games/:gameId
- Delete a gameGET /api/games/:gameId/image
- Generate an image of the game boardcurl -X POST -H "Content-Type: application/json" -d '{"size": 4}' http://localhost:3000/api/games
curl -X POST -H "Content-Type: application/json" -d '{"direction": "up"}' http://localhost:3000/api/games/:gameId/move
curl -X GET http://localhost:3000/api/games/:gameId
from loadimg import load_img
from huggingface_hub import InferenceClient
# or load a local image
my_b64_img = load_img(imgPath_url_pillow_or_numpy ,output_type="base64" )
client = InferenceClient(api_key="hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": my_b64_img # base64 allows using images without uploading them to the web
}
}
]
}
]
stream = client.chat.completions.create(
model="meta-llama/Llama-3.2-11B-Vision-Instruct",
messages=messages,
max_tokens=500,
stream=True
)
for chunk in stream:
print(chunk.choices[0].delta.content, end="")