{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "9f0e1e4b-e36a-4dfe-adfd-6f99fb1d39f6", "metadata": {}, "outputs": [], "source": [ "import os\n", "from app import animate_images, AudioInput, SpotifyApi" ] }, { "cell_type": "code", "execution_count": 2, "id": "98b2afd2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Fetching Space from: https://huggingface.co/spaces/runwayml/stable-diffusion-v1-5\n", "Gradio Blocks instance: 3 backend functions\n", "-------------------------------------------\n", "fn_index=0\n", " inputs:\n", " |-dataset\n", " outputs:\n", " |-textbox\n", " |-gallery\n", "fn_index=1\n", " inputs:\n", " |-textbox\n", " outputs:\n", " |-gallery\n", "fn_index=2\n", " inputs:\n", " |-textbox\n", " outputs:\n", " |-gallery\n" ] } ], "source": [ "\n", "import gradio as gr\n", "stable_diffusion = gr.Blocks.load(name=\"spaces/runwayml/stable-diffusion-v1-5\")\n", "gallery_dir = stable_diffusion(\"hi\", fn_index=0)\n", "\n", "print(stable_diffusion)\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "778fa4aa-cc12-4c33-a866-47ddcedcaf5f", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING:spodcast.podcast:Downloaded Hello Internet: Nine Ladies Dancing\n" ] } ], "source": [ "def test_spotify_downloads():\n", " url = \"https://open.spotify.com/episode/3Ev4jlIjT8IVih1Oxidhqf?si=54a95e8fb07640c5\"\n", " api = SpotifyApi(url=url)\n", " api.download_episode()\n", " api.download_image()\n", " api.get_title()\n", "\n", "test_spotify_downloads()" ] }, { "cell_type": "code", "execution_count": null, "id": "237e3903", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from moviepy.editor import ImageClip\n", "\n", "ImageClip(img=\"/notebooks/stablepod/temp/1ae3a379.jpg\")" ] }, { "cell_type": "code", "execution_count": null, "id": "de461d9b-bfbb-4d2d-b35e-fc3889494991", "metadata": {}, "outputs": [], "source": [ "def get_test_image_paths():\n", " gallery_dir = \"temp/images\"\n", " return [os.path.join(gallery_dir, img) for img in os.listdir(gallery_dir)][:2]\n", "\n", "get_test_image_paths()" ] }, { "cell_type": "code", "execution_count": null, "id": "99df13fd-bd5d-4964-9300-016fcf7625e6", "metadata": {}, "outputs": [], "source": [ "def get_test_audio_paths():\n", " audio_path = \"temp/audio.mp3\"\n", " audio_input = AudioInput(audio_path, 10, 10)\n", " return audio_input\n", "\n", "get_test_audio_paths()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.9.13 ('stablepod-9sY-ATvg')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" }, "vscode": { "interpreter": { "hash": "da5cbbacbb5b0f4f981824ef371d6caff76d7da138a6d755a2c960f48ddcd478" } } }, "nbformat": 4, "nbformat_minor": 5 }