Add more prompts and fix flask

This commit is contained in:
Hayk Martiros 2022-12-22 20:27:35 -08:00
parent 15b04f0b75
commit 732bfb0e5f
3 changed files with 30 additions and 12 deletions

View File

@ -117,15 +117,20 @@ export default function ModelInference({
setNumRequestsMade((n) => n + 1);
// Customize for baseten
const apiHandler = useBaseten ? process.env.NEXT_PUBLIC_RIFFUSION_BASETEN_GC_URL : "/api/server";
const apiHandler = useBaseten
? process.env.NEXT_PUBLIC_RIFFUSION_BASETEN_GC_URL
: "/api/server";
const payload = useBaseten
? { worklet_input: inferenceInput }
: inferenceInput;
// NOTE(hayk): Clean this up with server.js, there's something fishy going on.
const headers = useBaseten ? { "Content-Type": "application/json" } : {};
const response = await fetch(apiHandler, {
method: "POST",
body: JSON.stringify(payload),
headers: { 'Content-Type': 'application/json' }
headers: headers,
});
const data = await response.json();
@ -134,10 +139,7 @@ export default function ModelInference({
if (useBaseten) {
if (data?.output) {
newResultCallback(
inferenceInput,
data.output
);
newResultCallback(inferenceInput, data.output);
} else {
console.error("Baseten call failed: ", data);
}

View File

@ -1,5 +1,5 @@
export default async function handler(req, res) {
let headers = {
const headers = {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
};

View File

@ -1,24 +1,32 @@
// List of interesting prompts to randomly sample.
export const samplePrompts = [
"a folksy blues song from the mississippi delta around 1910",
"acoustic folk violin jam",
"ancient chinese hymn",
"anger rap",
"arabic gospel vocals",
"bongos on a havana street",
"brazilian Forró dance",
"bossa nova with distorted guitar",
"bubblegum eurodance",
"church bells",
"classical italian tenor operatic pop",
"copacabana beach",
"deep, smooth synthwave with a dream-like atmosphere",
"emotional disco",
"funk bassline with a jazzy saxophone",
"ibiza at 3am",
"jamaican dancehall vocals",
"jazzy clarinet with maracas",
"jazzy rapping from paris",
"k-pop boy group",
"latent space vaporwave",
"lo-fi beat for the holidays",
"mambo but from kenya",
"piano concerto in a minor",
"mambo but from Kenya",
"piano concerto in A minor",
"post-teen pop talent show winner",
"psychedelic nepalese trance",
"rock and roll electric guitar solo",
"scott joplin style ragtime piano",
"smooth tropical dance jazz",
"swing jazz trumpet",
"techno DJ and a country fiddle",
@ -28,21 +36,29 @@ export const samplePrompts = [
export const rollTheDicePrompts = [
"(caribbean:1.5) (jazz:0.3)",
"alarm clock",
"arabic (vocals:1.5)",
"bird calls",
"baroque new wave pop",
"Berlin and Paris electronic fused together with acoustic tunes",
"breathing",
"brazilian Forró dance",
"british soul dance",
"chainsaw funk",
"church organ with a harpsichord",
"clarinet with maracas",
"classic rock mellow gold progressive",
"classical flute",
"cowbell ballad",
"funky human music",
"hip hop vocals piano cowbell",
"interdimensional cable",
"jamaican ska rap",
"laughing",
"lucky disco punk",
"new orleans blues",
"piano funk",
"pop r&b urban contemporary",
"reggae fusion",
"Shepard tone",
"smelly clown",
"square dancing in wyoming",
"tropical deep sea",
"tropical electro house moombahton",