Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,28 +49,11 @@ def assign_alert(alert_message: str) -> str:
|
|
| 49 |
return "Alert could not be assigned automatically. Please check manually."
|
| 50 |
|
| 51 |
|
| 52 |
-
# Tool: Transcribe audio and generate a timeline using Hugging Face ASR
|
| 53 |
-
@tool
|
| 54 |
-
def transcribe_audio(audio_path: str) -> str:
|
| 55 |
-
"""Transcribe audio and log events with timestamps.
|
| 56 |
-
Args:
|
| 57 |
-
audio_path: Path to the audio file.
|
| 58 |
-
"""
|
| 59 |
-
try:
|
| 60 |
-
result = asr_pipeline(audio_path)
|
| 61 |
-
transcript = result["text"]
|
| 62 |
-
timestamped_events = [f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {line}" for line in transcript.split('.')]
|
| 63 |
-
return "\n".join(timestamped_events)
|
| 64 |
-
except Exception as e:
|
| 65 |
-
return f"Error transcribing audio: {str(e)}"
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
final_answer = FinalAnswerTool()
|
| 69 |
|
| 70 |
model = HfApiModel(
|
| 71 |
-
max_tokens=
|
| 72 |
temperature=0.5,
|
| 73 |
-
model_id='
|
| 74 |
custom_role_conversions=None,
|
| 75 |
)
|
| 76 |
|
|
|
|
| 49 |
return "Alert could not be assigned automatically. Please check manually."
|
| 50 |
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
model = HfApiModel(
|
| 54 |
+
max_tokens=2096,
|
| 55 |
temperature=0.5,
|
| 56 |
+
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',
|
| 57 |
custom_role_conversions=None,
|
| 58 |
)
|
| 59 |
|