Y

@yescode1

y

Python
2 months ago
body { font-family: Arial; background: whitesmoke; padding: 30px; text-align: center; } h1 { color: orangered; } h1 + p { background: whitesmoke; padding: 10px 20px;

uin

Python
2 months ago
import base64, requests from config import HF_API_KEY API_URL = "https://router.huggingface.co/v1/chat/completions" HEADERS = {"Authorization": f"Bearer {HF_API_KEY}", "Content-Type": "application/json"} MODELS = [ "zai-org/GLM-4.5V", "Qwen

uyuio

Python
2 months ago
def run_math_mastermind(): st.title("🧮 Math Mastermind") st.session_state.setdefault("history_mm", []) st.session_state.setdefault("k_mm", 0) c1, c2 = st.columns([1, 2]) if c1.button("🧹 Clear", key="c_mm"): st.session_state.histo

my

Python
2 months ago
def token_limit_activity(): print("\n=== TOKEN LIMIT ACTIVITY ===\n") long_prompt = input( "Enter a long prompt (more than 300 words, e.g., a detailed story or description): " ).strip() if long_prompt: long_response

uy

Python
3 months ago
feedback = input("Provide feedback for improvement: ").strip() improved_response = f"{initial_response} (Improved with your feedback: {feedback})" print(f"\nImproved AI Response: {improved_response}") print("\nReflection:") pri

jfdjj

Python
3 months ago
try: return img_client.text_to_image( prompt=prompt, negative_prompt=NEGATIVE, model=MODEL_ID, ), None except Exception as e: msg = str(e)

Object Detection with Hugging Face and P...

Python
3 months ago
#!/usr/bin/env python3 # Object Detection (concise, correct Content-Type). Requires: pillow, requests, config.py (HF_API_KEY). import os, io, time, random, requests, mimetypes from datetime import datetime from PIL import Image, ImageDraw, ImageFont

siort

Python
3 months ago
Category: fruit Item: apple Answer: Yes, apple is a fruit. Now you try: Category: {category} Item: {item} Answer:""" print("\n--- ONE-SHOT LEARNING ---")

fdf

Python
3 months ago
# PART 3: Your prompt print("\nPART 3: YOUR OWN INSTRUCTION PROMPT") custom = input("Enter your instruction-based prompt: ").strip() try: temp = float(input("Set temperature (0.1 to 1.0): ").strip()) if not (0.1 <=

css

Python
3 months ago
<h1>My Colour Card</h1> <!-- Inline CSS: Add style="color: ____;" inside this p tag --> <p style="color: crimson;">Hi! This is my very own webpage.</p> <div id="my-card"> <h2>About Me</h2>

Post-Processing Magic Workshop: Enhancin...

Python
3 months ago
import time import requests from PIL import Image, ImageEnhance, ImageFilter from io import BytesIO from config import HF_API_KEY MODELS = [ "ByteDance/SDXL-Lightning", "black-forest-labs/FLUX.1-dev", "stabilityai/stable-diffusion-xl-ba

color

Python
3 months ago
import pygame def main(): pygame.init() screen_width, screen_height = 500, 500 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption('color changing sprite') # Mapping of color names to RGB

Collision Check

Python
3 months ago
if isCollision(enemyX[i], enemyY[i], bulletX, bulletY): bulletY = PLAYER_START_Y bullet_state = "ready" score_value += 1 enemyX[i] = random.randint(0, SCREEN_WIDTH - 64) enemyY[i]

Introduction to Text-to-Image Generation

Python
3 months ago
from huggingface_hub import InferenceClient from datetime import datetime from PIL import Image from config import HF_API_KEY # MODEL PRIORITY LIST - Primary model first, fallbacks only if it fails MODELS = [ "ByteDance/SDXL-Lightning", "st

uytuio

Python
3 months ago
import pygame pygame.init() SCREEN_WIDTH, SCREEN_HEIGHT = 500, 500 display_surface = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_caption('Adding image and background image') # Load and scale images directly background_i

prompt eng.

Python
3 months ago
# Choose ONE provider by importing it: #Change groq --> hf to use hugging face API #Change hf --> groq to use groq API from groq import generate_response def prompt_engineering_activity(): print("Welcome to the AI Prompt Engineering Tutorial

pygame

Python
3 months ago
print("\n=== Daily Denomination Report ===") for slot in range(1, 7): # outer for -- one denomination per loop if slot == 1: value, total = 100, total_100 elif slot == 2: value, total = 50, total_50 elif slot == 3: v

forms

Python
3 months ago
<br> <fieldset> <legend>Your Visit</legend> <label>Choose your Doctor</label><br> <select id="doctor"> <option value="">-- Select a doctor --</option>

jktrtyu

Python
3 months ago
<h2>💪 Why Your Body Needs Exercise</h2> <p>Your body is like a supercar — the more you use it, the stronger it gets! Kids who move for <strong>60 minutes every day</strong> are happier, sleep bette

Leveraging Large Language Models (LLMs)

Python
3 months ago
import requests from colorama import Fore, Style, init from config import HF_API_KEY init(autoreset=True) DEFAULT_MODEL = "google/pegasus-xsum" def build_api_url(model_name): """ Builds the Hugging Face API URL using the model name.