Search

Results include substring matches and semantically similar vals. Learn more
dhvanil avatar
web_Zw1Asa4o7V
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_Zw1Asa4o7V(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Hidden Pattern: AI's Market Manipulation Exposed</title>
<style>
body {
font-family: 'Courier New', monospace;
iamseeley avatar
hfApiGateway
@iamseeley
🤖 A gateway to Hugging Face's Inference API You can perform various NLP tasks using different models . The gateway supports multiple tasks, including feature extraction, text classification, token classification, question answering, summarization, translation, text generation, and sentence similarity. Features Feature Extraction : Extract features from text using models like BAAI/bge-base-en-v1.5 . Text Classification : Classify text sentiment, emotions, etc., using models like j-hartmann/emotion-english-distilroberta-base . Token Classification : Perform named entity recognition (NER) and other token-level classifications. Question Answering : Answer questions based on a given context. Summarization : Generate summaries of longer texts. Translation : Translate text from one language to another. Text Generation : Generate text based on a given prompt. Sentence Similarity : Calculate semantic similarity between sentences. Usage Send a POST request with the required inputs to the endpoint with the appropriate task and model parameters. Or use the default models. # Example Default Model Request curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction" Example Requests Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": ["Hello World", "Goodbye World"]}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=BAAI/bge-base-en-v1.5" Feature Extraction curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World", "How are you?", "Nice to meet you."]}}' "https://iamseeley-hfapigateway.web.val.run/?task=feature-extraction&model=sentence-transformers/all-MiniLM-L6-v2" Text Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "I love programming!"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-classification&model=j-hartmann/emotion-english-distilroberta-base" Token Classification curl -X POST -H "Content-Type: application/json" -d '{"inputs": "My name is John and I live in New York."}' "https://iamseeley-hfApiGateway.web.val.run/?task=token-classification&model=dbmdz/bert-large-cased-finetuned-conll03-english" Question Answering curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"question": "What is the capital of France?", "context": "The capital of France is Paris, a major European city and a global center for art, fashion, gastronomy, and culture."}}' "https://iamseeley-hfapigateway.web.val.run/?task=question-answering&model=deepset/roberta-base-squad2" Summarization curl -X POST -H "Content-Type: application/json" -d '{"inputs": "The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct."}' "https://iamseeley-hfapigateway.web.val.run/?task=summarization&model=sshleifer/distilbart-cnn-12-6" Translation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Hello, how are you?"}' "https://iamseeley-hfapigateway.web.val.run/?task=translation&model=google-t5/t5-small" Text Generation curl -X POST -H "Content-Type: application/json" -d '{"inputs": "Once upon a time"}' "https://iamseeley-hfapigateway.web.val.run/?task=text-generation&model=gpt2" Sentence Similarity curl -X POST -H "Content-Type: application/json" -d '{"inputs": {"source_sentence": "Hello World", "sentences": ["Goodbye World"]}}' "https://iamseeley-hfapigateway.web.val.run/?task=sentence-similarity&model=sentence-transformers/all-MiniLM-L6-v2" Val Examples Using Pipeline import Pipeline from "https://esm.town/v/iamseeley/pipeline"; // ... } else if (req.method === "POST") { const { inputs } = await req.json(); const pipeline = new Pipeline("task", "model"); const result = await pipeline.run(inputs); return new Response(JSON.stringify(result), { headers: { "Content-Type": "application/json" } }); } } exampleTranslation exampleTextClassification exampleFeatureExtraction exampleTextGeneration exampleSummarization exampleQuestionAnswering
HTTP
## 🤖 A gateway to Hugging Face's Inference API
You can perform various NLP tasks using different [models](https://huggingface.co/models). The gateway supports multiple task
## Features
- **Feature Extraction**: Extract features from text using models like `BAAI/bge-base-en-v1.5`.
- **Text Classification**: Classify text sentiment, emotions, etc., using models like `j-hartmann/emotion-english-distilrober
- **Token Classification**: Perform named entity recognition (NER) and other token-level classifications.
const defaultModels = {
"feature-extraction": "sentence-transformers/all-MiniLM-L6-v2",
"text-classification": "distilbert-base-uncased-finetuned-sst-2-english",
"token-classification": "dbmdz/bert-large-cased-finetuned-conll03-english",
jeffreyyoung avatar
assertiveBeigeCarp
@jeffreyyoung
An interactive, runnable TypeScript val by jeffreyyoung
HTTP
const replicate = new Replicate({
auth: Deno.env.get("REPLICATE_API_KEY"),
export default serve({
async *handleMessage(req) {
const lastMsg = req.query.at(-1);
const lastAttachment = lastMsg?.attachments?.at?.(0);
const url = lastAttachment?.url;
const content = lastMsg?.content?.trim();
if (!url) {
yield "Please send a image";
tsuchi_ya avatar
gemini2FlashExample
@tsuchi_ya
An interactive, runnable TypeScript val by tsuchi_ya
Script
import { GoogleGenerativeAI } from "npm:@google/generative-ai";
const prompt = "日本の関西での一般的な挨拶を教えて。";
const genAI = new GoogleGenerativeAI(Deno.env.get("GOOGLE_GENERATIVE_AI"));
const model = genAI.getGenerativeModel(
{ model: "gemini-2.0-flash-exp" },
const result = await model.generateContent(prompt);
console.log(result.response.text());
pomdtr avatar
oauthConcept
@pomdtr
// oauth middleware protect the val behind github oauth
HTTP
// oauth middleware protect the val behind github oauth
export default oauth({
scopes: ["read:user"],
client_id: Deno.env.get("GITHUB_CLIENT_ID"),
client_secret: Deno.env.get("GITHUB_CLIENT_SECRET"),
auth_url: "https://github.com/login/oauth/authorize",
token_url: "https://github.com/login/oauth/access_token",
}, async (req: Request, accessToken: string) => {
const octokit = new Octokit({ auth: accessToken });
const { data: { login } } = await octokit.rest.users.getAuthenticated();
snm avatar
untitled4965473
@snm
An interactive, runnable TypeScript val by snm
Script
import { trackOpenAiFreeUsage } from "https://esm.town/v/snm/trackOpenAiFreeUsage";
import { openAiTextCompletion } from "https://esm.town/v/patrickjm/openAiTextCompletion?v=8";
import { openAiModeration } from "https://esm.town/v/snm/openAiModeration";
import { openAiFreeQuotaExceeded } from "https://esm.town/v/patrickjm/openAiFreeQuotaExceeded?v=2";
import { openAiFreeUsageConfig } from "https://esm.town/v/snm/openAiFreeUsageConfig";
* OpenAI text completion. https://platform.openai.com/docs/api-reference/completions
* To see if the quota has been met, you can run @patrickjm.openAiFreeQuotaExceeded()
* For full REST API access, see @patrickjm.openAiTextCompletion
openAiKey?: string,
const apiKey = params.openAiKey ?? openAiFreeUsageConfig.key;
jacoblee93 avatar
untitled_silverPinniped
@jacoblee93
An interactive, runnable TypeScript val by jacoblee93
Script
const { ChatPromptTemplate } = await import("npm:langchain/prompts");
const { ChatOpenAI } = await import("npm:langchain/chat_models/openai");
const { StringOutputParser } = await import(
["human", "{input}"],
const model = new ChatOpenAI({
modelName: "gpt-4",
temperature: 0.2,
openAIApiKey: process.env.OPENAI_API_KEY,
// Output parser converts the chat message into a raw string. Also works with streaming.
stevekrouse avatar
untitled_orangeImpala
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export const untitled_orangeImpala = fetchJSON(
"https://api.openai.com/v1/usage?date=2023-11-01",
headers: {
authorization: "Bearer " + Deno.env.get("openai"),
cyrilis avatar
untitled2983099
@cyrilis
An interactive, runnable TypeScript val by cyrilis
Script
export let untitled2983099 = default (params) => {
return gpt3({
openAiKey: process.env.openai_key,
prompt: params.question,
.then((result) => result);
jacoblee93 avatar
untitled_chocolateSquid
@jacoblee93
An interactive, runnable TypeScript val by jacoblee93
Script
export const untitled_chocolateSquid = (async () => {
const { ChatOpenAI } = await import(
"https://esm.sh/langchain@0.0.146/chat_models/openai"
const { LLMChain } = await import("https://esm.sh/langchain@0.0.146/chains");
["human", humanTemplate],
const chat = new ChatOpenAI({
temperature: 0,
openAIApiKey: process.env.OPENAI_API_KEY,
const chain = new LLMChain({
cyrilis avatar
untitled8745444
@cyrilis
An interactive, runnable TypeScript val by cyrilis
Script
export let untitled8745444 = default (params) => {
return gpt3({
openAiKey: process.env.openai_key,
prompt: params.question,
.then((result) => result);
cyrilis avatar
untitled8294445
@cyrilis
An interactive, runnable TypeScript val by cyrilis
Script
export let untitled8294445 = default (params) => {
return gpt3({
openAiKey: process.env.openai_key,
prompt: params.question,
.then((result) => result);
32
Next