feat: refactor code and finetune OOM fix
This commit is contained in:
@@ -6,14 +6,12 @@ import requests
|
||||
class LLMAcousticBridge:
|
||||
def __init__(self, model_name="dolphin-llama3:8b"):
|
||||
self.model_name = model_name
|
||||
# Динамический выбор URL (внутри Docker используется emom_ollama)
|
||||
base_url = os.getenv("OLLAMA_API_URL", "http://emom_ollama:11434")
|
||||
self.api_url = f"{base_url}/api/generate"
|
||||
|
||||
def get_acoustic_profile(self, valence, arousal, semantics):
|
||||
context_str = ", ".join(semantics) if semantics else "abstract scene"
|
||||
|
||||
# Строгий промпт с примером вывода
|
||||
prompt = f"""
|
||||
Analyze the visual context and emotions to determine the ideal background music properties.
|
||||
Emotions: Valence {valence:.1f}/9.0 (Positivity), Arousal {arousal:.1f}/9.0 (Energy).
|
||||
|
||||
Reference in New Issue
Block a user