Skip to content

Commit

Permalink
Update colab
Browse files Browse the repository at this point in the history
  • Loading branch information
ionic-bond committed Apr 28, 2024
1 parent 0f5008f commit c7bd337
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions stream_translator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"outputs": [],
"source": [
"# @title Install\n",
"!apt install libcublas11\n",
"!pip install stream-translator-gpt"
]
Expand All @@ -41,9 +42,18 @@
},
"outputs": [],
"source": [
"!stream-translator-gpt https://www.youtube.com/watch?v=r1dytEjbUqo --model large --language ja \\\n",
"# @title Run\n",
"URL = \"https://www.youtube.com/watch?v=r1dytEjbUqo\" # @param {type:\"string\"}\n",
"model = \"large\" # @param [\"small\", \"medium\", \"large\"] {allow-input: true}\n",
"language = \"ja\" # @param {type:\"string\"}\n",
"translation_prompt = \"Translate from Japanese to Chinese, only output the translation, do not output the original text\" # @param {type:\"string\"}\n",
"translation_engine = \"google\" # @param [\"openai\", \"google\"]\n",
"api_key = \"AIzaSyCPYq1F3WOlSGbWFcERf5qCv1hlo2SKOG8\" # @param {type:\"string\"}\n",
"translation_history_size = \"2\" # @param [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\"] {allow-input: true}\n",
"\n",
"!stream-translator-gpt \"{URL}\" --model {model} --language {language} \\\n",
" --use_faster_whisper \\\n",
" --gpt_translation_prompt \"Translate from Japanese to Chinese, only output the translation, do not output the original text\" --google_api_key \"AIzaSyCPYq1F3WOlSGbWFcERf5qCv1hlo2SKOG8\" --gpt_translation_history_size 2"
" --gpt_translation_prompt \"{translation_prompt}\" --{translation_engine}_api_key \"{api_key}\" --gpt_translation_history_size {translation_history_size}"
]
}
],
Expand Down

0 comments on commit c7bd337

Please sign in to comment.