Update app.py
Browse files
app.py
CHANGED
|
@@ -115,7 +115,7 @@ api_key = os.environ.get("GROQ_API_KEY")
|
|
| 115 |
if not api_key:
|
| 116 |
raise ValueError("GROQ_API_KEY no est谩 configurada en las variables de entorno.")
|
| 117 |
client = Groq(api_key=api_key)
|
| 118 |
-
model_name = "llama-3.
|
| 119 |
chat_groq = ChatGroq(model=model_name)
|
| 120 |
|
| 121 |
# Funciones de procesamiento
|
|
@@ -202,7 +202,7 @@ def organize_clinical_record(current_text, transcription_text, pdf_text):
|
|
| 202 |
"""
|
| 203 |
try:
|
| 204 |
organized_text = chat_groq.invoke(prompt)
|
| 205 |
-
return organized_text
|
| 206 |
except Exception as e:
|
| 207 |
print(f"Error al invocar ChatGroq: {e}")
|
| 208 |
return current_text # Return the current text if the API call fails
|
|
@@ -239,7 +239,7 @@ def process_input(audio, pdfs, current_text):
|
|
| 239 |
# Actualizar registro cl铆nico
|
| 240 |
organized_record = organize_clinical_record(updated_text, transcription_chunk, pdf_chunk)
|
| 241 |
if organized_record:
|
| 242 |
-
updated_text = organized_record
|
| 243 |
|
| 244 |
# Evaluar RAID solo con el audio (conversaci贸n actual)
|
| 245 |
if text_label == "Audio" and chunk:
|
|
|
|
| 115 |
if not api_key:
|
| 116 |
raise ValueError("GROQ_API_KEY no est谩 configurada en las variables de entorno.")
|
| 117 |
client = Groq(api_key=api_key)
|
| 118 |
+
model_name = "llama-3.3-70b-versatile"
|
| 119 |
chat_groq = ChatGroq(model=model_name)
|
| 120 |
|
| 121 |
# Funciones de procesamiento
|
|
|
|
| 202 |
"""
|
| 203 |
try:
|
| 204 |
organized_text = chat_groq.invoke(prompt)
|
| 205 |
+
return organized_text.content
|
| 206 |
except Exception as e:
|
| 207 |
print(f"Error al invocar ChatGroq: {e}")
|
| 208 |
return current_text # Return the current text if the API call fails
|
|
|
|
| 239 |
# Actualizar registro cl铆nico
|
| 240 |
organized_record = organize_clinical_record(updated_text, transcription_chunk, pdf_chunk)
|
| 241 |
if organized_record:
|
| 242 |
+
updated_text = organized_record
|
| 243 |
|
| 244 |
# Evaluar RAID solo con el audio (conversaci贸n actual)
|
| 245 |
if text_label == "Audio" and chunk:
|