Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,16 +7,13 @@ from gtts import gTTS
|
|
7 |
import tempfile
|
8 |
import whisper
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
-
|
|
|
13 |
|
14 |
-
|
15 |
-
api_key = os.getenv("GROQ_API_KEY")
|
16 |
-
if not api_key:
|
17 |
-
raise ValueError("API key for Groq is not set. Please set the environment variable GROQ_API_KEY.")
|
18 |
|
19 |
-
client = Groq(api_key=api_key)
|
20 |
|
21 |
# Load Whisper model
|
22 |
model = whisper.load_model("base")
|
@@ -58,7 +55,7 @@ iface = gr.Interface(
|
|
58 |
outputs=[gr.Textbox(label="Summary"), gr.Audio(label="Audio Summary")],
|
59 |
title="Document Summarizer",
|
60 |
description="Upload a Word or PDF document and get a summary with audio playback.",
|
61 |
-
theme=gr.themes.Monochrome()
|
62 |
)
|
63 |
|
64 |
# Launch the interface with sharing enabled
|
|
|
7 |
import tempfile
|
8 |
import whisper
|
9 |
|
10 |
+
# Load Groq API key from environment variable
|
11 |
+
groq_api_key = os.getenv('GROQ_API_KEY')
|
12 |
+
if not groq_api_key:
|
13 |
+
raise ValueError("GROQ_API_KEY environment variable is not set.")
|
14 |
|
15 |
+
groq_client = Groq(api_key=groq_api_key)
|
|
|
|
|
|
|
16 |
|
|
|
17 |
|
18 |
# Load Whisper model
|
19 |
model = whisper.load_model("base")
|
|
|
55 |
outputs=[gr.Textbox(label="Summary"), gr.Audio(label="Audio Summary")],
|
56 |
title="Document Summarizer",
|
57 |
description="Upload a Word or PDF document and get a summary with audio playback.",
|
58 |
+
theme=gr.themes.Monochrome()
|
59 |
)
|
60 |
|
61 |
# Launch the interface with sharing enabled
|