Skip to content

Instantly share code, notes, and snippets.

@spinagon
spinagon / openrouter_llava.py
Created November 24, 2023 11:53
Sending picture to openrouter llava model
url = "https://openrouter.ai/api/v1/chat/completions"
headers = {"Authorization": "Bearer {}".format(or_api_key)}
r = requests.post(
url=url,
headers=headers,
json={"model": "haotian-liu/llava-13b",
"messages": [{"role": "user", "content": [
{"type": "text", "text": "What's in this picture?"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}]}]})
#!venv/bin/python3
import asyncio
import logging
import re
import shelve
import time
import aiohttp
from llm_horde import horde_request
"Tim! Do you want a bar of gold?"
Tim, raincoat on, about to leave for the weekend, was completely flummoxed by the question. He froze in place, one foot out of the door, and considered the offer. And then considered how seriously he was meant to consider the offer. Obviously, he thought to himself, he wanted a bar of gold. Who wouldn't? And yet, the logistical questions—
"Come over here," Diane told him. "You need to see this."
"I've got to go," Tim said, checking the time. "At a dead run, I can just about get to the stop before my bus does."
Diane was on the other side of the office. She was the only other person left in the place. She shook her head. "Uh-uh. I promise you, it's worth it."
import numpy as np
import sys
def check_rows(cells):
for rownum in range(0, 9):
row = [x for x in cells[rownum] if x != 0]
if len(np.unique(row)) < len(row):
return False
return True
role_packages.each do |role_package|
puts role_package['instances']
puts role_package['context']
end
A BBC TV journalist is interviewing a elderly former Polish fighter pilot.
Interviewer: So Mr Stanczewski, I understand that in 1943 you shot down five German aircraft in a single engagement. Could you tell us what happened?
Polish Fighter Pilot: Well we were flying at 20,000 feet when we spotted five Fokkers flying along below us. So we dived down and I aimed at one of the Fokkers and fired a burst from my machine guns right into him and he exploded. Then I saw that one of the Fokkers was on my tail, so I pulled round in a loop and got behind him, and fired and he went down on fire. I looked around and saw two Fokkers attacking my squadron leader, so slipped in behind them, and fired, and that was another Fokker going down in flames. The other Fokker tried to get away from me, but I got right up behind him, and blasted him with my machine guns and turned over and exploded. There was only one of the Fokkers left now, and he was trying to get away, but I flew up behind him, shot - bang, bang, bang - and he b
def score(dice)
sum = 0
count = Hash.new(0)
dice.each {|die| count[die == 1 ? :"10" : :"#{die}"] += 1}
count.each {|d, c| sum += d.to_s.to_i * 100 * (c / 3); count[d] = c % 3}
sum += count[:"10"] * 100 + count[:"5"] * 50
end
class String
alias dud dup
end
esacpu = 'esacpu'
puts !esacpu.dud.upcase!
#NoEnv
#Persistent
#InstallKeybdHook
#InstallMouseHook
BlackSound:="*-1"
NiggaSound:="*-1"
if !FileExist("lists.txt")
#NoEnv
#Persistent
#InstallKeybdHook
#InstallMouseHook
BlackSound:="*-1"
NiggaSound:="*-1"
if !FileExist("lists.txt")