Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,12 @@ from io import BytesIO
|
|
| 5 |
import tempfile
|
| 6 |
import boto3
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
|
| 15 |
def create_meeting_summary(uploaded_audio):
|
| 16 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
|
@@ -19,11 +19,12 @@ def create_meeting_summary(uploaded_audio):
|
|
| 19 |
for segment in transcript.segments:
|
| 20 |
transcript_text += f"{segment['text']}\n"
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# s3.put_object(Bucket=bucket_name, Key=file_name, Body=csv_buffer)
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
| 27 |
|
| 28 |
inputs = [
|
| 29 |
gr.Audio(type="filepath", label="ι³ε£°γγ‘γ€γ«γγ’γγγγΌγ")
|
|
|
|
| 5 |
import tempfile
|
| 6 |
import boto3
|
| 7 |
|
| 8 |
+
s3 = boto3.client(
|
| 9 |
+
's3',
|
| 10 |
+
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
|
| 11 |
+
aws_secret_access_key=os.environ["AWS_SECRET_ACCESS_KEY"],
|
| 12 |
+
region_name='ap-northeast-1'
|
| 13 |
+
)
|
| 14 |
|
| 15 |
def create_meeting_summary(uploaded_audio):
|
| 16 |
openai.api_key = os.environ["OPENAI_API_KEY"]
|
|
|
|
| 19 |
for segment in transcript.segments:
|
| 20 |
transcript_text += f"{segment['text']}\n"
|
| 21 |
|
| 22 |
+
file_name = f'test.txt'
|
| 23 |
+
s3.put_object(Bucket=bucket_name, Key=file_name, Body=transcript_text)
|
|
|
|
| 24 |
|
| 25 |
+
download_url = os.environ["DOWNLOAD_URL"] + "test.txt"
|
| 26 |
+
|
| 27 |
+
return download_url
|
| 28 |
|
| 29 |
inputs = [
|
| 30 |
gr.Audio(type="filepath", label="ι³ε£°γγ‘γ€γ«γγ’γγγγΌγ")
|