Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,5 @@
|
|
1 |
|
2 |
|
3 |
-
# Commented out IPython magic to ensure Python compatibility.
|
4 |
-
# %%shell
|
5 |
-
# pip install -q langchain_community langchain_huggingface faiss-cpu gradio openai google-generativeai langchain-google-genai torch torchvision torchaudio youtokentome pypdf accelerate
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
# Commented out IPython magic to ensure Python compatibility.
|
10 |
-
# %%capture
|
11 |
-
# %%shell
|
12 |
-
#
|
13 |
-
# # Install the custom version of NeMo by AI4Bharat
|
14 |
-
# wget https://indic-asr-public.objectstore.e2enetworks.net/ai4b_nemo.zip
|
15 |
-
#
|
16 |
-
# unzip -q /content/ai4b_nemo.zip && cd NeMo
|
17 |
-
# bash reinstall.sh
|
18 |
-
#
|
19 |
-
# cd ..
|
20 |
-
#
|
21 |
import os
|
22 |
import subprocess
|
23 |
import sys
|
@@ -62,44 +44,6 @@ if not os.path.exists(setup_flag):
|
|
62 |
os.execv(sys.executable, ['python'] + sys.argv)
|
63 |
|
64 |
|
65 |
-
# Commented out IPython magic to ensure Python compatibility.
|
66 |
-
# %%capture
|
67 |
-
# %%shell
|
68 |
-
#
|
69 |
-
# git clone -q https://github.com/VarunGumma/IndicTransTokenizer
|
70 |
-
# cd IndicTransTokenizer
|
71 |
-
# pip install -q --editable ./
|
72 |
-
# cd ..
|
73 |
-
#
|
74 |
-
|
75 |
-
|
76 |
-
# Commented out IPython magic to ensure Python compatibility.
|
77 |
-
# %%capture
|
78 |
-
# %%shell
|
79 |
-
#
|
80 |
-
# apt-get install libsndfile1-dev ffmpeg
|
81 |
-
|
82 |
-
# git clone https://github.com/gokulkarthik/TTS
|
83 |
-
# cd TTS
|
84 |
-
|
85 |
-
# pip3 install -e .[all]
|
86 |
-
# pip3 install -r requirements.txt
|
87 |
-
|
88 |
-
# cd ..
|
89 |
-
#
|
90 |
-
|
91 |
-
"""## **Restart session**
|
92 |
-
"""
|
93 |
-
|
94 |
-
# Commented out IPython magic to ensure Python compatibility.
|
95 |
-
# %%capture
|
96 |
-
# !pip install gradio
|
97 |
-
|
98 |
-
# Commented out IPython magic to ensure Python compatibility.
|
99 |
-
# %%capture
|
100 |
-
#
|
101 |
-
# # INFO: If you're unable to import these libraries, just rerun this cell again.
|
102 |
-
#
|
103 |
import gradio as gr
|
104 |
from torch import cuda, inference_mode
|
105 |
import nemo.collections.asr as nemo_asr
|
@@ -165,7 +109,7 @@ def get_gemini_output(prompt, temperature=0.6):
|
|
165 |
model = genai.GenerativeModel(model_name='gemini-pro')
|
166 |
answer = model.generate_content(prompt,
|
167 |
generation_config=genai.types.GenerationConfig(
|
168 |
-
temperature=0.
|
169 |
|
170 |
return answer.text
|
171 |
|
|
|
1 |
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import os
|
4 |
import subprocess
|
5 |
import sys
|
|
|
44 |
os.execv(sys.executable, ['python'] + sys.argv)
|
45 |
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
import gradio as gr
|
48 |
from torch import cuda, inference_mode
|
49 |
import nemo.collections.asr as nemo_asr
|
|
|
109 |
model = genai.GenerativeModel(model_name='gemini-pro')
|
110 |
answer = model.generate_content(prompt,
|
111 |
generation_config=genai.types.GenerationConfig(
|
112 |
+
temperature=0.1))
|
113 |
|
114 |
return answer.text
|
115 |
|