{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import os\n",
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1",
   "metadata": {},
   "outputs": [],
   "source": [
    "params = {\n",
    "    \"gen_id\": \"a7eb414f-5650-4d84-813f-a073a12d9899\",\n",
    "    \"text_prompt\": \"Transcribe the sung lyrics in the audio. Your response should only contain the lyrics, no other text.\"\n",
    "}\n",
    "\n",
    "response = requests.get(\n",
    "    \"https://suno-ai--qwen-omni-captioner-dev-instruct-audio-api.modal.run\",\n",
    "    params=params\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# First parse\n",
    "response_data = response.json()\n",
    "if isinstance(response_data, str):\n",
    "    response_json = json.loads(response_data)\n",
    "else:\n",
    "    response_json = response_data\n",
    "\n",
    "# Now extract the lyrics\n",
    "lyrics = response_json[\"response\"]\n",
    "print(lyrics)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "suno_clean",
   "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.10.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
