added getting number of tokens for proccessing and removed whisper settings
Browse files
app.py
CHANGED
|
@@ -3,15 +3,15 @@ import streamlit as st
|
|
| 3 |
import whisperx
|
| 4 |
import torch
|
| 5 |
from utils import convert_segments_object_to_text, check_password
|
| 6 |
-
from gigiachat_requests import get_access_token, get_completion_from_gigachat
|
| 7 |
|
| 8 |
if check_password():
|
| 9 |
st.title('Audio Transcription App')
|
| 10 |
st.sidebar.title("Settings")
|
| 11 |
-
|
| 12 |
-
device =
|
| 13 |
-
batch_size =
|
| 14 |
-
compute_type =
|
| 15 |
|
| 16 |
initial_giga_base_prompt = os.getenv('GIGA_BASE_PROMPT')
|
| 17 |
initial_giga_processing_prompt = os.getenv('GIGA_PROCCESS_PROMPT')
|
|
@@ -58,8 +58,9 @@ if check_password():
|
|
| 58 |
|
| 59 |
if (enable_summarization):
|
| 60 |
with st.spinner('Обрабатываем транскрибацию...'):
|
| 61 |
-
|
| 62 |
-
|
|
|
|
| 63 |
st.write("Результат обработки:")
|
| 64 |
st.text(transcript)
|
| 65 |
|
|
|
|
| 3 |
import whisperx
|
| 4 |
import torch
|
| 5 |
from utils import convert_segments_object_to_text, check_password
|
| 6 |
+
from gigiachat_requests import get_access_token, get_completion_from_gigachat, get_number_of_tokens
|
| 7 |
|
| 8 |
if check_password():
|
| 9 |
st.title('Audio Transcription App')
|
| 10 |
st.sidebar.title("Settings")
|
| 11 |
+
|
| 12 |
+
device = os.getenv('DEVICE')
|
| 13 |
+
batch_size = int(os.getenv('BATCH_SIZE'))
|
| 14 |
+
compute_type = os.getenv('COMPUTE_TYPE')
|
| 15 |
|
| 16 |
initial_giga_base_prompt = os.getenv('GIGA_BASE_PROMPT')
|
| 17 |
initial_giga_processing_prompt = os.getenv('GIGA_PROCCESS_PROMPT')
|
|
|
|
| 58 |
|
| 59 |
if (enable_summarization):
|
| 60 |
with st.spinner('Обрабатываем транскрибацию...'):
|
| 61 |
+
number_of_tokens = get_number_of_tokens(transcript, access_token)
|
| 62 |
+
transcript = get_completion_from_gigachat(giga_processing_prompt + transcript, number_of_tokens, access_token)
|
| 63 |
+
|
| 64 |
st.write("Результат обработки:")
|
| 65 |
st.text(transcript)
|
| 66 |
|