Han Lee
commited on
Commit
·
9a07faa
1
Parent(s):
07b5bcb
vertex ai
Browse files- app.py +17 -0
- requirements.txt +3 -1
app.py
CHANGED
@@ -10,6 +10,23 @@ desired_language = "en"
|
|
10 |
response_generator_pipe = TextGenerationPipeline(max_length=max_answer_length)
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
def main(audio: object):
|
14 |
"""Calls functions for deploying gradio app.
|
15 |
|
|
|
10 |
response_generator_pipe = TextGenerationPipeline(max_length=max_answer_length)
|
11 |
|
12 |
|
13 |
+
import vertexai
|
14 |
+
from vertexai.preview.language_models import ChatModel, InputOutputTextPair
|
15 |
+
|
16 |
+
vertexai.init(project="youtube-live-checker-245701", location="us-central1")
|
17 |
+
chat_model = ChatModel.from_pretrained("chat-bison@001")
|
18 |
+
parameters = {
|
19 |
+
"temperature": 0.2,
|
20 |
+
"max_output_tokens": 256,
|
21 |
+
"top_p": 0.8,
|
22 |
+
"top_k": 40
|
23 |
+
}
|
24 |
+
chat = chat_model.start_chat(
|
25 |
+
context="""Act as Santa and respond like I am a 10 year old child.""",
|
26 |
+
)
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
def main(audio: object):
|
31 |
"""Calls functions for deploying gradio app.
|
32 |
|
requirements.txt
CHANGED
@@ -4,4 +4,6 @@ gradio==3.14.0
|
|
4 |
SpeechRecognition==3.9.0
|
5 |
mtranslate==1.8
|
6 |
gTTS==2.3.0
|
7 |
-
transformers==4.25.1
|
|
|
|
|
|
4 |
SpeechRecognition==3.9.0
|
5 |
mtranslate==1.8
|
6 |
gTTS==2.3.0
|
7 |
+
transformers==4.25.1
|
8 |
+
google-cloud-aiplatform
|
9 |
+
vertexai==1.28.1
|