{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install vertexai"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import vertexai\n",
    "from vertexai.generative_models import GenerativeModel, GenerationConfig, Part\n",
    "\n",
    "os.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = (\n",
    "    \"/home/georg/notebooks/gpu_nb/nodal-figure-454817-e6-ed653c80232c.json\"\n",
    ")\n",
    "vertexai.init(project=\"nodal-figure-454817-e6\")\n",
    "\n",
    "model = GenerativeModel(\"gemini-2.0-flash\")\n",
    "\n",
    "prompt = \"\"\"\n",
    "Please transcribe the lyrics of the attached music piece.\n",
    "Use linesbreaks for song structure and square brackets for section headers like [Verse 1] or [Chorus] etc.\n",
    "\"\"\"\n",
    "\n",
    "audio_file_uri = \"/home/sara/samples/Did I Stutter_.mp3\"\n",
    "# audio_file_uri = \"gs://suno__test/sample_chinese.mp3\"\n",
    "\n",
    "audio_file = Part.from_uri(audio_file_uri, mime_type=\"audio/mpeg\")\n",
    "contents = [audio_file, prompt]\n",
    "\n",
    "response = model.generate_content(contents)\n",
    "# response = model.generate_content(contents, generation_config=GenerationConfig(audio_timestamp=True))\n",
    "\n",
    "print(response.text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "suno_env",
   "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.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
