Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import pandas as pd
|
|
| 9 |
from datasets import load_dataset
|
| 10 |
from deep_translator import GoogleTranslator
|
| 11 |
from langdetect import detect
|
| 12 |
-
import
|
| 13 |
|
| 14 |
# Set up Whisper with a smaller model or on CPU
|
| 15 |
model_name = "small" # Use "small", "base", or "medium" for smaller models
|
|
@@ -34,7 +34,7 @@ index.add(dataset_embeddings.cpu().numpy()) # Add the embeddings to the index
|
|
| 34 |
api_key = os.getenv("api_key")
|
| 35 |
# Set up Groq API with direct API key
|
| 36 |
|
| 37 |
-
client =
|
| 38 |
import torch
|
| 39 |
from transformers import pipeline
|
| 40 |
from langdetect import detect
|
|
|
|
| 9 |
from datasets import load_dataset
|
| 10 |
from deep_translator import GoogleTranslator
|
| 11 |
from langdetect import detect
|
| 12 |
+
from groq import Groq # Correct import for Groq API
|
| 13 |
|
| 14 |
# Set up Whisper with a smaller model or on CPU
|
| 15 |
model_name = "small" # Use "small", "base", or "medium" for smaller models
|
|
|
|
| 34 |
api_key = os.getenv("api_key")
|
| 35 |
# Set up Groq API with direct API key
|
| 36 |
|
| 37 |
+
client = Groq(api_key=api_key)
|
| 38 |
import torch
|
| 39 |
from transformers import pipeline
|
| 40 |
from langdetect import detect
|