File size: 736 Bytes
42cbd9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import whisper
import torch
from transformers import pipeline
from fireworks.client import Fireworks
from app.config import Config

# 🔹 Load AI Models
audio_model = whisper.load_model(Config.WHISPER_MODEL)
# 1. Specialized Sentiment Model (Direct Labeling)
sentiment_pipeline = pipeline(
    "text-classification",
    model="cardiffnlp/twitter-roberta-base-sentiment-latest",
    return_all_scores=False
)

# 2. Focused Emotion Model (Single Emotion)
emotion_pipeline = pipeline(
    "text-classification",
    model="j-hartmann/emotion-english-distilroberta-base",
    top_k=1
)

#yolo_model = torch.hub.load(Config.YOLO_MODEL, 'yolov5s')

# 🔹 Initialize Fireworks AI Client
client = Fireworks(api_key=Config.FIREWORKS_API_KEY)